在我的master分支中,有以下已合并的本地分支,但我想从master中移除 local_branch3 :
local_branch1 local_branch2 local_branch3 local_branch4从主服务器中删除 local_branch3 后,我希望它保持本地分支(只能从主服务器删除)。
我检查了史蒂夫哈曼的博客,但似乎也会永远删除本地分支。
,因为我发布在下面的评论之一:我希望主分支撤消由local_branch3合并产生的更改,而保持local_branch3不变。
原因是我想要ke当我调整 local_branch3 时, $ master 分支可交付。
和 git checkout master git revert -m 1<<< SHA1值>>然后在master分支中没有local_branch3代码。而locah_branch3将会保留。
In my master branch, there're following local branches that have been merged, but I would like to remove the local_branch3 from master:
local_branch1 local_branch2 local_branch3 local_branch4after removing the local_branch3 from master, I would like it to remain a local branch (only deleted from master).
I've check Steve Harman's blog on this similar issue, but that seems also deleting the local branch for ever.
Edit: to clarify what I meant, as I posted in one of the below comments:
I would like the master branch to undo the changes resulting from local_branch3 merging, while leaving local_branch3 untouched.
The reason being that I would like to keep the master branch deliverable while I tweak on local_branch3.
解决方案Maybe you mean reverting local_branch3 from master?
If so, first check SHA1 value of the commit which merges local_branch3. And
git checkout master git revert -m 1 <<SHA1 value>>Then no local_branch3 codes in master branch. And locah_branch3 will remain.
更多推荐
从主分支中移除一个合并分支
发布评论