Reputation: 329
I am using the GitHub web site to submit a pull request (e.g. development-Feature -> development). There are some cases where there is a conflict and it tell me that it can't automatically merge and to run the following command:
git checkout development
git merge development-Feature
git push origin development
When I run this command locally I get:
merge made by the 'recursive' strategy
Locally it does NOT have any conflicts (it automatically merged my conflicting files).
My question is, does GitHub (the web site) check for ANY conflicts (even if they can be auto merged) and just give up if there are any? I tried to find out what commands GitHub uses when doing a pull request but I can't seem to find it.
Thanks,
Upvotes: 3
Views: 175
Reputation: 130
You're doing it the opposite way. You should merge the developement in your feature branch.
Your local copy of branch development
is still in the "old" version. You have to update it manually.
if you type git fetch -p
, from any branch, it will download from the server the "metadata" about the branches, so in other words, your local git will be able to know that you are not updated with the latest version. The -p
argument will erase metadata from your local computer for branches that are no longer on github.
Now after doing the fetch
command, you can checkout your development branch, and you should see a message that you are "behind".
Now you need to type git pull origin development
(while being on the development branch) to actually get the data from the server.
Come back to your feature branch, and do a git merge development
. You will get the conflicts that github is talking about. Fix them, commit, and push. Github will then allow you to merge
tl;dr
git checkout development
git pull origin development
git checkout development-Feature
git merge development
git commit
git push origin development-Feature
Upvotes: 1