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

Re: Git branches - confusing behavior

From
PAPatrick Aljord <patcito-re5jqeeqqe8avxtiumwx3w@public.gmane.org>
Date
May 11, 2008, 15:25 UTC
Message-ID
<6b6419750805110825t51730d16y211d2c502a1b302d@mail.gmail.com>
In-Reply-To
<4826F72D.2070205-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Sun, May 11, 2008 at 8:39 AM, Dima Kagan <dima.kagan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> My proposed change shouldn't necessarily break the described workflow. Git can keep the current behavior for new branches, but automatically 'stash' the changes when checking-out an existing branch. At least having an optional parameter for "auto-stashing" will be nice.
>
> What do you think of that?
you can do just that with an alias, in .git/config add:
[alias]
        auto-stash = !git stash && git checkout $1

then type "git auto-stash master" or "git auto-stash some_branch" and it should stash and checkout the branch.

Cheers,
Pat

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Git for human beings" group. To post to this group, send email to git-users-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to git-users-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/git-users?hl=en -~----------~----~----~----~------~----~------~--~---

Previous: Dima Kagan
Message 19 of 19 in “Git branches - confusing behavior”
  1. Dima KaganMay 11, 2008
  2. Jakub NarebskiMay 11, 2008
  3. Dima KaganMay 11, 2008
  4. David SymondsMay 11, 2008
  5. Dima KaganMay 11, 2008
  6. David SymondsMay 11, 2008
  7. Dima KaganMay 11, 2008
  8. Steve FrécinauxMay 11, 2008
  9. Jakub NarebskiMay 11, 2008
  10. Dima KaganMay 11, 2008
  11. Björn SteinbrinkMay 11, 2008
  12. Dima KaganMay 11, 2008
  13. Björn SteinbrinkMay 11, 2008
  14. Dima KaganMay 11, 2008
  15. Teemu LikonenMay 11, 2008
  16. Miles BaderMay 12, 2008
  17. Theodore TsoMay 11, 2008
  18. Dima KaganMay 11, 2008
  19. Patrick AljordMay 11, 2008

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.