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

Commit to other branch

From
JSJohannes Schneider <mailings@cedarsoft.com>
Date
May 31, 2010, 15:46 UTC
Message-ID
<4C03D9C1.1060404@cedarsoft.com>
Hi guys,

I often run in that scenario: I see a small bugfix/typo/missing documentation. Of course I just add a bit of code to fix that issue... Then I'd like to commit that change as own commit. And most of the time this is possible without any problems (git commit <file>). But as I am *always* working on a topic branch, it takes some work to commit that change to another branch.

I tried to "git stash " But then *all* changes are stashed (including my changes)...

So at the moment I do that:

git commit <file> (on wrong branch) git stash git checkout pu git cherry-pick git checkout my-topic git reset --hard git stash apply

And that is much to much work. I just want to do something like that:
git commit <file> -b pu

But I don't think that is possible at the moment... Any hints, how I could solve that? How do you do that?

Thanks,
Johannes
-- 
Johannes Schneider - blog.cedarsoft.com
Next: Matthieu Moy
Message 1 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.