从发展中重新派驻当地分支机构 [英] Rebasing a local branch from develop
本文介绍了从发展中重新派驻当地分支机构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为来自development的功能分支建立基础.我正在使用PhpStorm Git集成,并且有2个不同的开发分支:
I want to rebase a feature branch from develop. I am using PhpStorm Git integration and I have 2 different develop branches:
refs/remotes/origin/develop
refs/heads/develop
为了不弄乱事情,我必须选择重新定位哪一个?
In order to do not mess up things, which one do I have to choose to rebase?
推荐答案
我不知道Git的phpstorm接口,但是在命令行中,我将执行以下操作:
I don't know the phpstorm interface for Git, but in the command line I'd do the following:
-
git checkout develop
-
git pull origin develop
->这将获取development分支的远程版本,并将其合并(或根据您的拉策略将其重新定位)到本地分支中/上.这样,本地版本和远程版本都是相同的 -
git checkout feature-brach
-
git rebase develop
git checkout develop
git pull origin develop
-> this fetches the remote version of the develop branch and merges it (or rebases it, depending on your pull strategy) into/onto your local branch. This way the local and the remote versions of develop are the samegit checkout feature-brach
git rebase develop
如果有任何冲突,请解决.之后,您可以针对develop
创建拉取请求.
If there are any conflicts - resolve them. After that you can create a pull request against develop
.
这篇关于从发展中重新派驻当地分支机构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文