git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: *Non*-interactive squash a range ?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jul 5, 2010, 06:27 UTC
Message-ID
<4C317B4B.3070100@viscovery.net>
In-Reply-To
<AANLkTimTx2dVlK9KKi1nZpOadwDcfyzhE8nffCyK1Sqm@mail.gmail.com>
Am 7/3/2010 15:38, schrieb David:
Show 9 quoted lines
> I tried this which seems to work:
>  $ git checkout uglybranch
>  $ git checkout -b cleanbranch
>  $ git reset --mixed E          # worktree same as uglybranch
>  $ git add .                    # adds any untracked files
>  $ git commit -a                # -a detects any removed files
> 
> So I'm thinking of using that method in a script. Have I overlooked
> anything? Is there a better way?
Use 'reset --soft' instead of 'reset --mixed' followed by 'add .'.
-- Hannes
Previous: DavidNext: Daniele Segato
Message 2 of 3 in “*Non*-interactive squash a range ?”
  1. DavidJul 3, 2010
  2. Johannes SixtJul 5, 2010
  3. Daniele SegatoJul 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.