Re: Volume of commits
- From
Karl Hasselström <kha@treskal.com>
- Date
- Jul 12, 2007, 14:03 UTC
- Message-ID
- <20070712140304.GB28310@diana.vm.bytemark.co.uk>
- In-Reply-To
- <m3ps2xu5hc.fsf@pc7.dolda2000.com>
On 2007-07-12 15:16:47 +0200, Fredrik Tolf wrote:
> Or do you somehow aggregate the smaller commits into larger patches > and recommit them? Or is there some third possibility that I'm > missing?
Aggregating commits and recommitting is easy, so that's a common tool, I'd say. But it's equally possible to take a large commit and pick it apart, for example by editing the patch by hand and reapplying it, or by using the hunk selection feature of git-gui.
For example, if you have just committed several changes as one big commit, you can do
$ git reset HEAD^
to undo the commit but retain the changes in your working tree, and then use git-gui to select a subset of the changes and commit them, then select another subset and commit that, and so on.
If you need to edit a commit that isn't HEAD, you can use git-reset to go back to the commit you want to edit, do the editing, and then use git-rebase to reapply the other commits on top of the changed commit.
In general, there are a thousand ways to use git to rewrite history, either "by hand" or by using tools such as StGIT. (StGIT is what I personally use most of the time. I find it a good tool for producing readable patch series.)
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle