[Top][All Lists]

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

Re: VC mode and git

From: Harald Hanche-Olsen
Subject: Re: VC mode and git
Date: Sun, 05 Apr 2015 11:39:34 +0200
User-agent: Postbox 3.0.11 (Macintosh/20140602)

Richard Stallman wrote:
You had recommended

     git add lisp/ChangeLog
     git commit

so I tried that.  git add completed with no output.
git commit showed me a monster list of files with
changes to be committed, and asked me for the log message.
I killed it.

What next?

That monster list of files is expected. If I am right, it reflects the changes made to origin/master, that is the central repository, *relative to your local master branch*.

So go ahead and commit. Give it a random commit message if you wish.
I promise you, you can back out of this if needed. I'll tell you how below, in fact.

Next, run: git diff origin/master

If I am right, you will see the changes you made, and nothing else.
If so, fix up your commit message to something more reasonable with git commit --amend, and you're good to go.

Assuming this is so, you will have fallen behind the central repo, so you need once more to do

git pull
# fix conflicts, if any
git push

and your're done.

Assuming you're still concerned because the output of that git diff command is not what you expected, here is what to do:

git branch wtf

That will create a new branch named “wtf” (you can call it something less offensive if you wish) to use for further diagnostics and recovery efforts. It will be identical to your now current master branch. Then

git reset --hard master^

That will reset the master branch right back where you had it before the last commit, but it will now be in a clean state. All the changes that were in your index and working tree are still in the “wtf” branch. At this point, ask for further help. I am going to suggest, if it comes to this, that you push the “wtf” branch to a temporary branch on the central repo so that more eyeballs can get on the case and make an accurate diagnosis.

– Harald

reply via email to

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