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

Re: Make 'git stash list' more informative

From
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Date
Apr 8, 2025, 02:06 UTC
Message-ID
<73A1707C-7B41-42C4-A530-E107FB8D5227@gmail.com>
In-Reply-To
<xmqqiknflj8j.fsf@gitster.g>
> After all, if they are related,
> you're more likely not keeping the work in the stash entries---you'd
> rather be making completed commit on the branch.

I don't if this the use case of Yuri, but in the past I kept a stash entry with some local development changes that shouldn't be committed and sent to the main repository. This is, I always applied that stash entry, did what I needed in my local environment, removed the code that was applied, then I committed the changes that should went to production.

It soon became hard to manage as I needed to use stash for other things. But hey, stash entries are commits, so I could somehow mimic its behavior without using stash itself! So, what I did:

1. Detached the HEAD:
$ git checkout --detach
2. Committed the local development changes. You can use the commit
message body to write a description of what those changes are.

$ git add my_changed_file $ git commit

3. Created a local tag, just for me:
$ git tag LOCAL_SETUP
4. Whenever I wanted to use that code, I just applied it by using:

$ git merge --squash LOCAL_SETUP $ git reset

This left the Git stash stack free for other uses and I could use it without worrying about the stash positions. If the problem is to have control over the stash, maybe the solution is to use the good old commits.

> ... this is an excellent suggestion.
Thanks :-)
Previous: Junio C Hamano
Message 4 of 4 in “Make 'git stash list' more informative”
  1. YuriApr 5, 2025
  2. Lucas Seiki OshiroApr 5, 2025
  3. Junio C HamanoApr 7, 2025
  4. Lucas Seiki OshiroApr 8, 2025

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.