私は過去にマスターに合併した支店をどのように削除できますか?以下のようなものから履歴をマージしてブランチを削除しますか?
:
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
Seconded。マスターのインタラクティブなrebaseを行い、deleteは 'e'をコミットします。 「branch1」と同値。 –
同様の状況についてこの質問をチェックしてください:http://stackoverflow.com/questions/17577409/git-remove-merge-commit-from-history – alexbclay