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

Re: Git branches - confusing behavior

From
DKDima Kagan <dima.kagan@gmail.com>
Date
May 11, 2008, 12:17 UTC
Message-ID
<4826E3DE.5020506@gmail.com>
In-Reply-To
<ee77f5c20805110513k4d34c8f8m83dd9d75a8ec47f4@mail.gmail.com>
Show 20 quoted lines
> On Sun, May 11, 2008 at 10:11 PM, Dima Kagan <dima.kagan@gmail.com> wrote:
>> David Symonds wrote:
>>> On Sun, May 11, 2008 at 9:58 PM, Dima Kagan <dima.kagan@gmail.com> wrote:
>>>
>>>> That's a subjective point of view :) I'm coming from the SVN world and uncommitted changes on one branch don't affect other branches. Is there a way I can achieve this behavior with git?
>>> If you *really* want SVN's behaviour of "branches", just copy your
>>> whole working tree (including the .git directory) and start making
>>> changes in that. Then they'll be completely separate and you can just
>>> 'cd' between them.
>>>
>>>
>>> Dave.
>> What's the point of using git then? :) I like the way branches are created and switched in git, but I would like each branch to preserve it's own history of modifications. Is that too much to ask? :)
> 
> Preserving history is called "committing", which is how git branches
> preserve their own history. You said you don't want to commit changes.
> You can't have it both ways.  :-P
> 
> 
> Dave.

Not quite. :) The current branch knows what files have been modified without committing the changes. Why should other branches be aware of these changes until I commit them?

Previous: David SymondsNext: Steve Frécinaux
Message 7 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.