Re: merging multiple commit into one?
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- May 11, 2009, 13:50 UTC
- Message-ID
- <m38wl3n3zj.fsf@localhost.localdomain>
- In-Reply-To
- <1de9d39c0905110621p6858bca8y8bb036a167754672@mail.gmail.com>
jean-luc malet <jeanluc.malet@gmail.com> writes:
Show 9 quoted lines
> Hi, > I often commit "useless" code, for example before going into weekend > or for saving some state during a dev process > often thoses commit are simply useless and the commit message looks > like "COMPILE ERROR - temporary save .... " > at the end I have LOT of theses commits that are useless and I want to > save some space/time/tree complexity merge multiple sequential commits > (without branch) into one > is it possible?
It is possible; one solution would be to use "git rebase --interactive" and its 'squash' command...
> according to my knowledge of git, removing the commit and rewriting > the last commit log so that it better reflect the modification will do > the job but I'm not sure git allow it...
...but you can simply pick up where you saved snapshot by using "git commit --amend" (or doing soft or mixed reset to previous commit before comitting changes).
-- Jakub Narebski Poland ShadeHawk on #git