DISQUS

DISQUS Hello! Phil Dawes' Stuff is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Frequent code checkpointing with git

Started by phildawes · 9 months ago

A nice feature of distributed version control is that you can commit into your repository more often because you aren’t impacting others with each commit. Recently I’ve been taking this to the extreme using git and performing a commit almost at every save. I have an emacs key ... Continue reading »

1 comment

  • Have you tried using git-rebase -i ? You need to give it the commit id of the last commit before your string of changes. You can then tell it to combine all your commits into one (or more).

    # *hack*
    git commit -a -m"one"
    # *hack*
    git commit -a -m"two"
    git rebase -i HEAD~2
    # bring us an editor, select the "one" and "two" as squash, save, exit.
    git log

    An alternative workflow is to use git commit --amend. But this does not keep your micro history around. It just puts any recent changages into the last commit.

    # *hack*
    git commit -a -m"I am working on blah"
    # *hack*
    git commit --amend
    ...

    -Bart

Add New Comment

Returning? Login