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

Re: Commit to other branch

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 31, 2010, 16:28 UTC
Message-ID
<vpq8w70m3wf.fsf@bauges.imag.fr>
In-Reply-To
<4C03D9C1.1060404@cedarsoft.com>
Johannes Schneider <mailings@cedarsoft.com> writes:
> I tried to "git stash "
> But then *all* changes are stashed (including my changes)...

Not completely answering the question, but "git stash -k" (--keep-index) allows you to do a selective stash. If you have relevant changes staged, and want to commit the unstaged ones elsewhere, you can do something like

git stash -k git checkout elsewhere git commit git checkout back-to-your-branch git stash pop

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Johannes SchneiderNext: Jeff King
Message 2 of 4 in “Commit to other branch”
  1. Johannes SchneiderMay 31, 2010
  2. Matthieu MoyMay 31, 2010
  3. Jeff KingMay 31, 2010
  4. Jan HudecJun 6, 2010

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.