Git pull results in extraneous “Merge branch” messages in commit log

后端 未结 5 1614
傲寒
傲寒 2020-12-04 07:02

I\'m working with another developer on a project, and we\'re using Github as our remote repo. I\'m on a Mac using git 1.7.7.3, he\'s on Windows using git 1.7.6.

This

5条回答
  •  一生所求
    2020-12-04 07:59

    There is actually a much simpler answer to this. Just have developer B do a pull BEFORE making his commit. This will prevent those merge commits, since they're caused by the history you've created on your local repo from your local commit trying to merge with the history of the commits on the remote repo. If you get a message saying something along the lines of 'changes will be overwritten' when doing a pull, it just means you both touched the same file, so do:

    git stash
    git pull
    git stash pop
    

    then you can resolve any merge conflicts if there are any.

提交回复
热议问题