は、あなたの歴史は次のようになります。
A -- B -- C (saveme,master)
....その後、あなたが壊れたライブラリーに対応するため、より多くのmaster
上で作業するとき、あなたの歴史は次のようになります。
A -- B -- C (saveme) -- D -- E (master)
あなたがmaster
にsaveme
をマージしようとした場合saveme
の完全な履歴がすでにmaster
に含まれているのでだから、それは「すでに最新の」と言います。あなたが望むのは、saveme
とまったく同じツリーを持つコミットを作成することですが、master
の上にもう1つコミットするだけです。その後、D
をE
をコミットし、ためgit revert
を使用してこれを行うことができますが、あなたが一度にそれをしたい場合は、次の操作を実行できます。
# Check that "git status" is clean:
git status
# Set the index (staging area) to be as it was at the tip of the branch saveme:
git read-tree saveme
# Create a commit based on that index:
git commit -m "Going back to the state of the branch 'saveme'"
# Your working tree will still be as it was when you started, so
# you'll want to reset that to the new commit:
git reset --hard
(これは私が提案レシピの些細な変化でありますthis answer)次に、あなたの歴史は次のようになります。
A -- B -- C (saveme) -- D -- E -- F (master)
...しかし、コミットF
の木はコミットC
のと同じになります。