Git workflow and rebase vs merge questions

后端 未结 11 2436
春和景丽
春和景丽 2020-11-22 03:09

I\'ve been using Git now for a couple of months on a project with one other developer. I have several years of experience with SVN, so I guess I bring a lot of baggage to th

11条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 03:59

    I have one question after reading your explanation: Could it be that you never did a

    git checkout master
    git pull origin
    git checkout my_new_feature
    

    before doing the 'git rebase/merge master' in your feature branch?

    Because your master branch won't update automatically from your friend's repository. You have to do that with the git pull origin. I.e. maybe you would always rebase from a never-changing local master branch? And then come push time, you are pushing in a repository which has (local) commits you never saw and thus the push fails.

提交回复
热议问题