Rebasing remote branches in Git

前端 未结 4 1293
甜味超标
甜味超标 2020-12-12 09:41

I am using an intermediate Git repository to mirror a remote SVN repository, from which people can clone and work on. The intermediate repository has it\'s master branch reb

4条回答
  •  生来不讨喜
    2020-12-12 10:37

    Because you rebased feature on top of the new master, your local feature is not a fast-forward of origin/feature anymore. So, I think, it's perfectly fine in this case to override the fast-forward check by doing git push origin +feature. You can also specify this in your config

    git config remote.origin.push +refs/heads/feature:refs/heads/feature
    

    If other people work on top of origin/feature, they will be disturbed by this forced update. You can avoid that by merging in the new master into feature instead of rebasing. The result will indeed be a fast-forward.

提交回复
热议问题