Merging changes
Your push to the remote repository will be rejected if your local repository is outdated.
![You cannot push to the remote repository if your local repo is outdated. Diagram of a ouddated repo.](/static/2e49227db3f41d50cf381b533dece47b/5a190/01.png)
When this is the case, you can use the git merge command to integrate the latest changes from your local copy of the remote branch before you push. Git enforces this to ensure that changes made by other members get retained in the version history.
![You must merge the latest changes before pushing if your local repo is outdated. Diagram of a merging latest changes.](/static/43189904f00529e66b6fe2cde2f2f9e1/5a190/02.png)
During a merge, Git will attempt to automatically apply historical changes and merge them with the current branch. However, if there is a conflict, an error will prompt you to resolve it manually.