[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: Thu, 26 Mar 2015 13:16:09 +0100
User-agent: Postbox 3.0.11 (Macintosh/20140602)

I have a few more minutes. Here is a rough outline of a course of action. It is good if someone else is willing to review these suggestions.

Run “git diff -- lisp/ChangeLog”.

If the output looks sane, run

git add lisp/ChangeLog
git commit

But don't try to push it yet! That will fail. Run:

git checkout -b badmerge
git checkout master
git reset --hard origin/master
git checkout -b rms dca743f0941909a80e3f28c023977120b6203e20

Now, if all that went well, your master branch is back in sync with the remote, you have the result of your bad merge in the badmerge branch, and you have your latest good commit on the rms branch.

If I have understood correctly, only your changes to lisp/ChangeLog are now missing from the rms branch. To fix that, do

git checkout badmerge
# copy your additions to lisp/ChangeLog and save them somewhere safe
git checkout rms
# edit lisp/ChangeLog, putting in your additions
git commit -a # or just use C-x v v

Now all your local changes are safely in the “rms” branch.

If all is well so far, you need to update your master branch:

git checkout master
git pull --ff-only

And now you can do one of two things:

One is (assuming you're still on master)

git merge rms
git push

And if all is well, you're done!
You may now wish to clean up by removing the badmerge and rms branches.

If you have merge conflicts, DON'T ever use C-x v v after resolving conflicts in a single file. Instead, just do git add on the files as you are fixing them, and commit when done with all of them.

An alternative route is to rebase your rms base on the current tip of the master branch, but that is beyond my experience.

– Harald

reply via email to

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