例如,我正在处理功能分支,另一位开发人员刚刚推动起源/开发他的最新修复,我必须在我的功能分支中使用(添加)他的修复。
我应该怎么做?
git checkout -b my-feature-branch
... dealing with my issue ...
... alarm! another developer just released his fix, I need it here in my feature branch ...
git stash
git checkout develop
git pull origin develop
git rebase my-feature-branch develop
git checkout my-feature-branch
git merge develop
git stash apply
... dealing with my issue ...
git commit
git checkout develop
git merge my-feature-develop
git push origin develop
这是正确的行为吗?
在那种情况下,很难弄清楚我的分支从哪里开始以及在哪里完成。第二点我正在rebase
为公共分支(开发)做,这不好,对吧?
用新信息更新(刷新)工作分支的正确方法是什么?