From: Jakub Narebski <jnareb@gmail.com>
To: MALET Jean-Luc <jeanluc.malet@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: merging multiple commit into one?
Date: Tue, 12 May 2009 00:36:06 +0200 [thread overview]
Message-ID: <200905120036.06965.jnareb@gmail.com> (raw)
In-Reply-To: <4A08A291.2060009@gmail.com>
On Tue, 12 May 2009, MALET Jean-Luc wrote:
> Jakub Narebski wrote:
>> jean-luc malet <jeanluc.malet@gmail.com> writes:
>>> 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).
>>
>>
> hi! thanks for your answers!
> I didn't knew about --amend for commit, will certainly use it...
> however it seems that I get missunderstood...
> A-o-o-o-o-o-B-o-o-o-o-C
> \-o-o-D-/
> let say I have the above tree, o are temporary unbuildable commits, A B
> C D are usable versions
> I want as posteriory remove the o to get the following tree
> A-B---C
> \-D/
> in fact I just wanna clean a little my tree since I forgot to amend ;)
> is this possible?
> ok I know, the best is to prevent! not to cure! so I'll amend ;)
As I wrote above, you can use interactive rebase to clean up history.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2009-05-11 22:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 13:21 merging multiple commit into one? jean-luc malet
2009-05-11 13:31 ` Andreas Ericsson
2009-05-11 13:50 ` Jakub Narebski
2009-05-11 22:11 ` MALET Jean-Luc
2009-05-11 22:36 ` Jakub Narebski [this message]
2009-05-12 15:59 ` jean-luc malet
2009-05-11 21:29 ` Heiko Voigt
2009-05-11 22:11 ` MALET Jean-Luc
2009-05-12 15:53 ` Heiko Voigt
2009-05-12 20:37 ` Markus Heidelberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200905120036.06965.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=jeanluc.malet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).