1.从分支图上观察可以看到,当使用--no-ff把dev分支向master主干merge后,dev分支会落后于master分支。
这时如果继续从dev上开发,当push时就会报错:
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
EGit会提示什么“远程分支已经变化,请先合并master分支........”的错误
2.解决办法:
切换到dev分支,使用rebase讲master分支合并到dev分支。这样dev分支就和master分支同步了。错误解决。注意不要用merge虽然也能解决问题。但是会把分支图搞的比较乱。关注merge和rebase区别。
3.虽然问题得到解决,但是没有搞明白为什么-no-ff的方式向master主干分支合并后。继续dev分支开发,为什么push时还会受到master分支影响
4.问题讨论帖子:https://www.v2ex.com/t/83599