Re: git pull opinion

Previous thread: git pull opinion by Aghiles on Monday, November 5, 2007 - 2:52 pm. (37 messages)

Next thread: [Patch] Documentation: enhanced "git for CVS users" doc about shared repositories by Francesco Pretto on Monday, November 5, 2007 - 3:32 pm. (17 messages)
From: Jakub Narebski
Date: Monday, November 5, 2007 - 3:28 pm

If I remember correctly there is/was some preliminary work (at most 'pu'
stages) about adding --dirty option to git-merge, git-pull and git-rebase.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


-

From: Johannes Schindelin
Date: Monday, November 5, 2007 - 5:08 pm

Hi,


There was, but AFAICT these are dead now.

The consense was that you are much better off committing first, then 
pulling.  And if the work you are doing really is not committable, but you 
_have_ to pull _now_, you use stash.  Although you are quite likely to 
revert the pull when it succeeds, and _then_ unstash.

Ciao,
Dscho

-

From: Aghiles
Date: Monday, November 5, 2007 - 9:22 pm

Sorry but I don't really understand why one should "revert the pull" ? Could
elaborate for a newbie ? :)

- Aghiles.
-

From: Johannes Schindelin
Date: Tuesday, November 6, 2007 - 5:02 am

Hi,


Yes, no problem.

A pull is just a fetch and a merge.  And a merge is a commit with more 
than one parent.  So you can use the command "git reset --hard HEAD^" to 
undo a merge, just as you can undo any other commit.

NOTE: if you pushed that commit (merge or not), do _not_ use reset.  This 
effectively rewrites history, and _will_ upset people pulling from you.  
If you really have to undo a commit you already published, use "git revert 
<commit>".

Hth,
Dscho

-

From: Junio C Hamano
Date: Tuesday, November 6, 2007 - 11:13 am

*DANGER*

A pull is usually just a fetch and a merge, but sometimes it can
fast forward.  ORIG_HEAD, not HEAD^, points at the previous HEAD
location in both cases.

-

From: Johannes Schindelin
Date: Tuesday, November 6, 2007 - 11:28 am

Hi,


Oops. Right.

Thanks,
Dscho

-

Previous thread: git pull opinion by Aghiles on Monday, November 5, 2007 - 2:52 pm. (37 messages)

Next thread: [Patch] Documentation: enhanced "git for CVS users" doc about shared repositories by Francesco Pretto on Monday, November 5, 2007 - 3:32 pm. (17 messages)