Skip navigation

Lost password? | Help

/dev/random

Random stuff to remember

Git - edit last commit

, ,

Git is a wonderful SCM. We use svn centrally as our source code repository. I use git-svn to create my local copy. My typical workflow is:
  1. Get updates from svn
    $ git svn rebase

  2. Make changes.
  3. Commit changes locally
    $ git commit -a

  4. Commit changes to svn
    $ git svn dcommit



There are times between step 3, and 4 when i want to edit my commit log message. Here are the steps i follow (shamelessly copied from here):
  1. Soft reset the current HEAD to HEAD^
    $ git reset --soft HEAD^

  2. Make changes to tree.
  3. Commit changes with editing last log message
    $ git commit -c ORIG_HEAD

  4. Commit changes to svn
    $ git svn dcommit

January 2010
M T W T F S S
December 2009February 2010
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31