# Pack several linear commits into one

3 messages from 2007-12-03 to 2007-12-03. Participants: Jacob Kroon, Peter Baumann, Jakub Narebski.
Thread: https://gitlist.dev/t/11117

## Jacob Kroon, 2007-12-03 09:06

Subject: Pack several linear commits into one
Message-ID: <c0d4c9e90712030106u40b871ecjd5f7b8d078c8be36@mail.gmail.com>
URL: https://gitlist.dev/e/c0d4c9e90712030106u40b871ecjd5f7b8d078c8be36%40mail.gmail.com

```
Hi,

Is there a tool for repacking several linear commits into one single ?

Please CC me since I'm not a subscriber to the list.

Best Regards
Jacob Kroon

```

## Peter Baumann, 2007-12-03 09:28

Subject: Re: Pack several linear commits into one
Message-ID: <20071203092859.GA6259@xp.machine.xx>
URL: https://gitlist.dev/e/20071203092859.GA6259%40xp.machine.xx
In-Reply-To: <c0d4c9e90712030106u40b871ecjd5f7b8d078c8be36@mail.gmail.com>

```
On Mon, Dec 03, 2007 at 10:06:11AM +0100, Jacob Kroon wrote:
> Hi,
> 
> Is there a tool for repacking several linear commits into one single ?
> 
> Please CC me since I'm not a subscriber to the list.
> 

Look for git merge --squash  or  git cherry-pick --no-commit

-Peter

```

## Jakub Narebski, 2007-12-03 09:32

Subject: Re: Pack several linear commits into one
Message-ID: <m3y7ccunrh.fsf@roke.D-201>
URL: https://gitlist.dev/e/m3y7ccunrh.fsf%40roke.D-201
In-Reply-To: <c0d4c9e90712030106u40b871ecjd5f7b8d078c8be36@mail.gmail.com>

```
"Jacob Kroon" <jacob.kroon@gmail.com> writes:

> Is there a tool for repacking several linear commits into one single ?

You can use either "git rebase --interactive" and replace 'pick' with
'squash', or (simpler for replacing all the commits by one big commit)
"git merge --squash". See documentation for details.

Note that if you want remove those 'several linear commits', you
better not have them published yet.

> Please CC me since I'm not a subscriber to the list.

You can read this list via archives, or using NNTP interface (in news
reader):

  nntp://news.gmane.org/gmane.comp.version-control.git

-- 
Jakub Narebski
ShadeHawk on #git
Poland

```
