[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Git - testing whether merge is possible
From: |
Johannes Schindelin |
Subject: |
Re: Git - testing whether merge is possible |
Date: |
Sun, 11 Nov 2007 15:27:16 +0000 (GMT) |
hI,
On Sun, 11 Nov 2007, Rune Zedeler wrote:
> I am a bit surprised that I found no git-documentation on how to test
> whether it will be possible to merge two branches without actually
> recording the merge.
I'd do the merge, but undo it right after that.
First, make sure that you have a clean working directory (no changes
staged or unstaged).
Then, do the merge (something like "git merge origin/master").
If it failed, you'll notice right away, and can go back to the old state
with "git reset --hard".
If it did not fail, you can go back to the original state with "git reset
--hard address@hidden".
The expression "address@hidden" can be used to reference the n'th last state
your HEAD had. To see a list of these states, just call "git reflog".
Hth,
Dscho