What to do when new commits happen after a git rebase?

。_饼干妹妹 提交于 2019-12-07 15:42:27
VonC

You should be able to rebase your commits again.

The only issue is that you will have to remake your conflict resolutions, because you did not activate git rerere.

Well,... you don't have to, with the rerere-train.sh script.
See "Do you even rerere?" by Tristan Roussel:

In this simplest form, the script starts from the commit you specified and go through every parent commit to look for conflicts.

That will allow you to record those past conflict resolutions, and rebase again without having to do them again.

cherry-pick for just merging specific commits but if your branch contains many commits that needs to be merged then better to rebase it.

Different people may have different best practices. I follow followings:

  1. git pull --rebase so that I can ensure my branch is up to date from the remote branch it was created.
  2. git push origin :feature_branch this will delete remove remote feature branch. Though I know I can simply do git push -force feature_branch but I want to be confirm that git will not mess up anything :) :) :)
  3. finally git push origin feature_branch

I will be glad to know your practice or suggest me something better.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!