[Top][All Lists]

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

Re: git is screwed

From: Steinar Bang
Subject: Re: git is screwed
Date: Wed, 25 Mar 2015 09:29:42 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (windows-nt)

>>>>> Richard Stallman <address@hidden>:

> Can someone tell me a full recipe for how to repair lisp/ChangeLog
> (perhaps, merge it by hand) and how to get the new version into
> the real repository?

I use magit (not (yet) on GNU Elpa, but available on marmalade (version
1.2.2) and Melpa (commit-triggered builds from magit git repo)), and
what I do, is: 

 1. 'M-x magit-status RET'
 2. This opens a buffer that looks like svn-status and pcl-cvs and it
    shows the results of the merge
     - The buffer will have three (maybe four) groups:
      - Untracked files
      - Unstaged changes
      - Staged changes
      - Unpushed commits (if you're working directly on a tracking branch)
     - Successfully merged files are shown under "Staged changes", and
       you can disregard them for now
     - Conflicted files are shown under "Unstaged changes" with a "C" in
       front of them
  3. I do 'g' in magit to ensure that any of the affected files I have
     in the buffers are reloaded from disk (this seems to happen
     automatically on emacs 24.4, but I still do the 'g')
  4. Then I enter the conflicted files and look for the conflict markers
     and see if I can make sense of them.  I usually force the file into
     fundamental-mode for this.  I try to manually fix the files and
     when I'm satisfied I move back to the magit buffer and position the
     cursor over the files and press 's" which moves the files from
     "Unstaged changes" to "Staged changes".
  5. As far as git is concerned the files are now reviewed and the merge
     can be completed, but I usually enter the file again and do "C-x v ="
     to view the diff and see if the diffs looks like I expected.
     I usually view the diffs of _all_ of the staged files before
     committing to see if they look sensible.  I also usually do a clean
     build, run unit tests and some smoke testing before committing
  6. In the magit buffer press 'c c' to commit the staged files.  The
     commit message comes up with git's default commit message. I
     usually add some comments about what I did with the conflicted

The merge is now complete and resides in the newest commit locally.  To
push the changes upsteam from magit, do 'P P' (only available if you're
on a tracking branch).

reply via email to

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