如何处理这个git rebase问题? [英] how to handle this git rebase issue?
问题描述
A - B- -C - D主分支
\
\ 1--2--3我的功能分支
但是,由于人们不断向master分支添加代码,我总是想要获取master分支的最新代码。请注意,我的功能位于目录中,因此在重新绑定或合并为主时不会发生冲突。我想要的是:
A - B - C - D - E - F
\\ \\
\ 1--2--3--4
什么git命令我应该使用吗?请注意,我已将我的功能分支推送到远程存储库。
您可以使用命令
git pull --rebase
因为您需要在 master
(而不是 origin / feature
)之上进行重新绑定,您还可以将其分解为:
git fetch
git rebase origin / master
(假设您的当前分支是您的功能分支)
I'm developing a new feature, so I create a new branch, like this:
A--B--C--D master branch
\
\-1--2--3 my feature branch
But given people is keeping adding code to master branch, I want to always to get latest code of master branch. Note, my feature is in a stand along directory, so there will be no conflict when rebase or merge to master. What I want is:
A--B--C--D--E--F
\
\-1--2--3--4
What git command should I use? Note that, I have pushed my feature branch to remote repository.
You can use the command
git pull --rebase
Since you need to rebase on top of master
(instead of origin/feature
), you can also break that into:
git fetch
git rebase origin/master
(assuming your current branch is your feature branch)
这篇关于如何处理这个git rebase问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!