あなただけのブランチmaster
が新しいその内容master^
とmaster
の間のデルタは、「ブランチbranch
の内容と一致するようにすべてを変える」ことで、branch
をブランチに同一のコミットを参照したい場合は、それは非常に簡単です:
$ git checkout branch
$ git symbolic-ref HEAD refs/heads/master
$ git status # you'll see what you're about to commit, here
$ git commit # make that new commit
注master
ための分岐履歴はないはここbranch
を参照すること。
あなたが道にbranch
ルックスをすべてを変えるマージ見えるようにコミットしたい場合は、これはトリックを行うようだが、私はよくそれをテストしていません。今すぐ
$ git checkout master
$ git merge --no-commit -s ours branch # this sets up the merge
$ git rm -r . # this empties it out
$ git checkout branch -- . # this adds everything from branch
$ git status # again, just to see what you're about to commit
$ git commit # and maybe edit the message to note that you took "branch"
master^
は何のマスターであります似ていて、master^2
の先端はbranch
の先端です。