public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail•com>
To: Brooke Kuhlmann <brooke@alchemists•io>, phillip.wood@dunelm•org.uk
Cc: git@vger•kernel.org, "brian m . carlson" <sandals@crustytoothpaste•net>
Subject: Re: Git Stash Synchronization - Best Workflow?
Date: Fri, 5 Sep 2025 15:03:53 +0100	[thread overview]
Message-ID: <7a206ee3-d68b-40fd-8133-79e4c2be7174@gmail.com> (raw)
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:
> 
> 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):>
> 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


  reply	other threads:[~2025-09-05 14:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-31 23:25 Git Stash Synchronization - Best Workflow? Brooke Kuhlmann
2025-09-01 10:10 ` Phillip Wood
2025-09-01 20:48   ` Brooke Kuhlmann
2025-09-05 14:03     ` Phillip Wood [this message]
2025-09-06 12:50       ` Brooke Kuhlmann
2025-09-10  9:52         ` Phillip Wood
2025-09-11  2:22           ` Brooke Kuhlmann
2025-09-19 14:04             ` Phillip Wood
     [not found]               ` <A42DC91A-91F2-4AB6-B0EE-52DE5135E99E@alchemists.io>
2025-09-19 19:54                 ` Brooke Kuhlmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a206ee3-d68b-40fd-8133-79e4c2be7174@gmail.com \
    --to=phillip.wood123@gmail$(echo .)com \
    --cc=brooke@alchemists$(echo .)io \
    --cc=git@vger$(echo .)kernel.org \
    --cc=phillip.wood@dunelm$(echo .)org.uk \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox