non-fast-forwarding git merges (was: Git)

martin f krafft madduck at madduck.net
Mon Dec 3 15:20:38 CET 2007


also sprach chombee <chombee at nerdshack.com> [2007.12.03.1404 +0100]:
> Is there some way to get git-pull to abort if it's not going to do
> a fast-forward? I think it just does a merge automatically. That's
> the problem, cause you might not be expecting it. It'd be good if
> it could warn you if a non-fast-forward merge was gonna happen.

I suggest not using git-pull. Instead, use git-fetch and git-merge,
then you are far closer to what's happening to your clone. git-pull
doesn't do anything else anyway.

Anyway, if a merge results in a non-ff, just point your HEAD to the
previous commit:

  git reset --hard HEAD^

Now you have the commits from the remote in a separate branch and
you can instead rebase or do the merge again.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"the condition of perfection is idleness.
 the aim of perfection is youth."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.madduck.net/pipermail/vcs-home/attachments/20071203/9a02830b/attachment.pgp>


More information about the vcs-home mailing list