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

Re: [RFC] git stash: add porcelain for sharing stashes through remotes

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 5, 2026, 07:47 UTC
Message-ID
<e1635b9c-bc03-4835-805f-5fa52f09364d@kdbg.org>
In-Reply-To
<20261005055337.7579-1-hananarshad619@gmail.com>
Am 05.10.26 um 07:53 schrieb Hanan Arshad:
Show 5 quoted lines
> The revised interface I have in mind is:
> 
> Publish one stash to a user-selected remote ref:
> 
> git stash publish <remote> <remote-ref> [<stash>]

I am actually not very happy with such an interface. The premise to have it is that stashes are something that can (and should) be shared with other people. But this is not the case. Stashes are strictly personal, short-lived, work-in-progress-not-worth-to-be-committed states. If you use stashes for longer-lived, worth-to-be-committed, sharable project states, then you are doing something wrong. You should be using branch labels instead.

Show 9 quoted lines
> 
> For example:
> 
> git stash publish origin refs/stashes/hanan/fix-login stash@{0}
> 
> If <stash> is omitted, stash@{0} would be used.
> 
> Internally this would reuse the existing stash export mechanism and
> normal push machinery. The original local stash would remain unchanged.

There you have it. If a stash is worth to be shown, then do take the long way via `git stash export`, and push the ref. Or just do

  git push origin stash@{0}:refs/stashes/hanan/fix-login
There's no magic support needed (nor, IMHO, desired).
-- Hannes
Previous: Hanan ArshadNext: Hanan Arshad
Message 4 of 10 in “[RFC] git stash: add porcelain for sharing stashes through remotes”
  1. Hanan ArshadSep 28, 2026
  2. brian m. carlsonSep 29, 2026
  3. Hanan ArshadOct 5, 2026
  4. Johannes SixtOct 5, 2026
  5. Hanan ArshadOct 5, 2026
  6. Johannes SixtOct 5, 2026
  7. Hanan ArshadOct 5, 2026
  8. Junio C HamanoOct 5, 2026
  9. Hanan ArshadOct 7, 2026
  10. Johannes SixtOct 7, 2026

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.