我怎么能删除我以前合并成主人的分支?删除历史中合并的分支?
从类似:
master
... a---> b ---> c ---------> d -----> e ---> f ---> g ---> h
\ /
x ---> y ------> z
branch1
到:
... a---> b ---> c ---------> d -----> f ---> g ---> h
\
x ---> y ---> z
branch1
我想撤销/删除一个分支合并到主我有时更早完成。
我试过类似的东西,但是我得到了冲突。可能吗 ?
# currently we are in <h> commit in master branch
git checkout master
# new temporary branch
git branch tmp_master
git checkout tmp_master
# reseting temp. branch to reqd. commit
git reset <d> --hard
# cherry-picking subsequent commits
git cherry-pick <f>..<h>
有人做过之后--as我意料中的事:
# change temp. branch to master branch
git branch -D master
git branch -m master
调查[rebasing](https://git-scm.com/docs/git-rebase) – vrwim
借调。做主交互式重定位并删除提交'e'。与'branch1'同上。 –
看看类似的情况下这个问题:http://stackoverflow.com/questions/17577409/git-remove-merge-commit-from-history – alexbclay