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

Re: Like commit -a, but...

From
TCTomas Carnecky <tomas.carnecky@gmail.com>
Date
Nov 5, 2012, 21:36 UTC
Message-ID
<1352151388-ner-1077@calvin>
In-Reply-To
<20121105205628.GG21244@inner.h.apk.li>
On Mon, 05 Nov 2012 21:56:28 +0100, Andreas Krey <a.krey@gmx.de> wrote:
Show 17 quoted lines
> On Mon, 05 Nov 2012 21:29:48 +0000, Andreas Krey wrote:
> ...
> > But still I'd like to know if there is a cleaner solution,
> > esp. with respect to the index.
> 
> Actually, it seems
> 
>  commit -m 'index'
>  commit -a -m 'worktree'
>  ...push
>  git reset HEAD^
>  git reset --soft HEAD^
> 
> might do the index trick.
> 
> But is there a direct way to convert the current working tree into a
> tree object?

PARENT=$(git rev-parse HEAD) TREE=$(git write-tree) COMMIT=$(git commit-tree -p $PARENT -m "message' $TREE) git push origin $COMMIT:refs/heads/teh-branch

write-tree+commit-tree is what git-commit does internally.
Previous: Andreas KreyNext: Andreas Schwab
Message 3 of 4 in “Like commit -a, but...”
  1. Andreas KreyNov 5, 2012
  2. Andreas KreyNov 5, 2012
  3. Tomas CarneckyNov 5, 2012
  4. Andreas SchwabNov 5, 2012

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.