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

Re: Git Stash Synchronization - Best Workflow?

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 5, 2025, 14:03 UTC
Message-ID
<7a206ee3-d68b-40fd-8133-79e4c2be7174@gmail.com>
In-Reply-To
<CE34C4BA-1ED4-458C-A31F-3DDB61ECCAAF@alchemists.io>
Hi Brooke
On 01/09/2025 21:48, Brooke Kuhlmann wrote:
> Hey Phillip, thanks!
> 
> I applied what you've suggested and still was only able to make push
 > and popping my stash with `git push --force` work. Actually, `git push
 > --force-with-lease` does work but I get this error still:
Show 6 quoted lines
> 
> To https://github.com/bkuhlmann/test
>   ! [rejected]                  refs/stashes/bkuhlmann -> refs/stashes/bkuhlmann (remote ref updated since checkout)
> error: failed to push some refs to 'https://github.com/bkuhlmann/test'
> 
> Despite that error showing up -- and the fact that I've applied your
 > changes -- the stash DOES get updated properly both locally and via
 > the remote. That didn't happen before.
That sounds like a bug if you're getting the rejected message above but 
the ref on the remote is still being updated. I'll try and take a look 
at that next week.
 > [...]> With the above enabled, my reflog ended up showing this (using my
 > "test" repository):>
Show 5 quoted lines
> 9305680c9afb (HEAD -> main, tag: 0.0.0, origin/main, origin/HEAD) HEAD@{6 minutes ago}: reset: moving to HEAD
> 9305680c9afb (HEAD -> main, tag: 0.0.0, origin/main, origin/HEAD) HEAD@{7 minutes ago}: reset: moving to HEAD
> 9305680c9afb (HEAD -> main, tag: 0.0.0, origin/main, origin/HEAD) HEAD@{8 minutes ago}: reset: moving to HEAD
> 
> I'm only seeing "reset: moving to HEAD" in my reflog when 
 > performing the push on my stash (in case that helps).
You need to pass the name of the ref whose reflog you want to look at, 
otherwise it defaults to showing the reflog for HEAD. You should be able 
to see the reflog for you exported stashes with
     git reflog refs/stashes/$USER
and the reflog for the remote tracking ref with
     git reflog refs/remote/origin/stashes/$USER
> Yeah, having the documentation reflect this would be nice in terms of
 > informing folks that you should enable what I've shown above. Ensuring
 > any change to the stash would also update the reflog would be helpful
 > too so folks can be implicit instead of explicit.
Let's try and find why the remote update say's it rejected when it isn't 
and then we can think about the best way to document pushing and pulling 
exported stashes.
Thanks
Phillip
Previous: Brooke KuhlmannNext: Brooke Kuhlmann
Message 4 of 9 in “Git Stash Synchronization - Best Workflow?”
  1. Brooke KuhlmannAug 31, 2025
  2. Phillip WoodSep 1, 2025
  3. Brooke KuhlmannSep 1, 2025
  4. Phillip WoodSep 5, 2025
  5. Brooke KuhlmannSep 6, 2025
  6. Phillip WoodSep 10, 2025
  7. Brooke KuhlmannSep 11, 2025
  8. Phillip WoodSep 19, 2025
  9. Brooke KuhlmannSep 19, 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.