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

question concerning branches

From
Ingo Brueckl <ib@wupperonline.de>
Date
Aug 20, 2009, 12:46 UTC
Message-ID
<4a8d4583@wupperonline.de>
In-Reply-To
<alpine.LFD.2.01.0908191441070.3158@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> branches have always been pointers to the top-of-commit
Obviously I expected them to be pointers on trees.

A kind of automatical starting commit in a newly created branch would at least warn if one has begun changing files and wants to checkout back. (Is this a feature worth of discussion?)

> the git behavior explicitly _encourages_ you to not have to decide
> before-the-fact to create a branch

Thanks for the explanation which help me to understand why git works like it does.

I'm able to follow your examples, but what I had it mind when I started the topic and my example was:

Assume a project is released (i.e. no more open bugs we know about) - I know we're drifting towards fantasy now. ;-)

On the one hand, I want to add single new features (such as other developers do) which will be written, tested and committed. I want to push/pull frequently to be up to date all the time. (master branch)

On the other hand, I want to completely rewrite the core of the program. (test or rewrite branch)

What is the git way to do this in a the right (and clever) manner?

In a branch, I learned, I have to commit or stash before I return to master for push/pull to follow the project. If I forget, I'm screwed, because files have changed due to the rewrite (in that branch), I won't get a warning until my first commit (in that branch) and commits (in master) will conflict.

Ingo
Previous: Randal L. SchwartzNext: Johannes Sixt
Message 16 of 21 in “question concerning branches”
  1. Ingo BruecklAug 19, 2009
  2. Bruce StephensAug 19, 2009
  3. Avery PennarunAug 19, 2009
  4. Ingo BruecklAug 19, 2009
  5. Jakub NarebskiAug 19, 2009
  6. Ingo BruecklAug 19, 2009
  7. Avery PennarunAug 19, 2009
  8. Matthieu MoyAug 20, 2009
  9. Jacob HelwigAug 19, 2009
  10. Jakub NarebskiAug 19, 2009
  11. Theodore TsoAug 19, 2009
  12. Jakub NarebskiAug 19, 2009
  13. Theodore TsoAug 20, 2009
  14. Linus TorvaldsAug 19, 2009
  15. Randal L. SchwartzAug 20, 2009
  16. Ingo BruecklAug 20, 2009
  17. Johannes SixtAug 20, 2009
  18. Jakub NarebskiAug 20, 2009
  19. Junio C HamanoAug 19, 2009
  20. Ingo BruecklAug 19, 2009
  21. Andreas EricssonAug 20, 2009

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.