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

Re: Usability of git stash

From
Andreas Ericsson <ae@op5.se>
Date
Oct 20, 2008, 09:49 UTC
Message-ID
<48FC542F.9010200@op5.se>
In-Reply-To
<87prly5k5r.fsf@cup.kalibalik.dk>
Anders Melchiorsen wrote:
Show 9 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
> 
>> In exchange for allowing new users to stub their toe on new commands, the
>> work flow of more experienced users is made a little easier.
> 
> I wonder whether experienced users even use stash a lot. Personally,
> after getting my head around the DAG, and thus getting more
> comfortable with git reset, I tend to make "WIP" commits instead.
> 

I use stash quite a lot. It's useful for me because my co-workers sometimes pull from me so I cannot use 'wip' commits (without annoying my co-workers anyway).

> After having used "git stash clear" at a bad time once, I am wary of
> stashing work that I actually want to keep. I prefer workflows where
> my mistakes can be (easily) corrected.
> 

I never use "stash clear", but always do "stash pop", so my stash-stack is hardly ever deeper than one. It would be a lot worse for us to get a "wip" commit accidentally propagated and built on further. It's happened and it's no fun what so ever as it requires team coordination and rewrite of published history to get it back to a good state.

Show 5 quoted lines
> 
> The primary thing that stash does for me is preserve the index state.
> Unfortunately, --index is not default for stash apply, so I often
> forget it.
> 

I commit regularly enough that it doesn't take me long at all to re-do the index changes.

> Sometimes, I also want stash to store away changes to untracked files
> (to get a clean working directory), but that is not possible.
> 

git add . git stash --index

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Miles BaderNext: Brandon Casey
Message 14 of 15 in “Usability of git stash”
  1. Anders MelchiorsenOct 15, 2008
  2. Brandon CaseyOct 15, 2008
  3. David KastrupOct 16, 2008
  4. Brandon CaseyOct 16, 2008
  5. Anders MelchiorsenOct 18, 2008
  6. Shawn O. PearceOct 19, 2008
  7. Leo RazoumovOct 19, 2008
  8. Shawn O. PearceOct 19, 2008
  9. Stephan BeyerOct 19, 2008
  10. Miles BaderOct 20, 2008
  11. Jeff KingOct 20, 2008
  12. Junio C HamanoOct 20, 2008
  13. Miles BaderOct 20, 2008
  14. Andreas EricssonOct 20, 2008
  15. Brandon CaseyOct 20, 2008

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.