[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VC mode and git

From: Stephen J. Turnbull
Subject: Re: VC mode and git
Date: Wed, 01 Apr 2015 02:11:29 +0900

Richard Stallman writes:

 > It usually takes weeks from when I write a change to when I check
 > it in to Savannah.  To check them in, I must first get the latest
 > changes from Savannah.  If I can't do a pull in that state, how can
 > I ever check them in?

    git stash
    git pull
    git stash apply
    # fix any conflicts
    git stash drop
    git commit <arguments>
    git push

If conflict fixing gets wedged, don't "stash drop" yet.  Instead, "git
reset --hard", then go to "git stash apply", and continue from there.

Andreas's suggestion[1] is simpler but makes the history DAG ugly.  In
particular, your commit message may get buried deep in the commit log
behind those of all of the pulled commits.  You'll have to ask Stefan
and the other frequent committers if they care about the ugliness.
Some do and some don't.

    git commit
    git pull
    # fix any conflicts
    # if fixed conflicts, commit
    git push

Note that if the conflict resolution work gets wedged, the "git reset
--hard" strategy works here as well.  You need to pull again rather
than "stash apply", of course.[2]

[1]  Andreas was laconic as ever, but I'm pretty sure the intended
strategy is to commit locally as soon as the change is complete to your
satisfaction, then when you have net access to Savannah do the pulling
and pushing.

[2]  This "pull" operation can also be done without a net connection,
but you may need to use "git merge origin/master" instead of "git pull".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]