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

Re: Bootstrapping into git, commit gripes at me

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 12, 2005, 04:59 UTC
Message-ID
<Pine.LNX.4.58.0507112149290.17536@g5.osdl.org>
In-Reply-To
<20050712044352.GA9919@buici.com>
On Mon, 11 Jul 2005, Marc Singer wrote:
> 
> Does it make sense to think about this branch as an flow of commits?
> Or is it just a starting point for a line of development?

It's really a flow of commits. Nothing will ever really remember what the starting point was at some later date if you have done commits, and the branch will always follow the _head_ of development on that branch.

So if you need to remember the starting point as a _static_ entity, you need to create a tag pointing to that place. You can do that at any point, very much including after you've already done development (but before you forget what to tag ;)

> If I make a branch, check it out, commit changes to it, and then clobber
> the working directory, can I later resume that branch of development
> without creating a new branch?

Absolutely. You can create a branch, commit to it, switch to another branch, commit to that one, switch back to the branch you created, and just go on. A branch will always follow the development.

> Do I need to set a tag to mark the last commit on that branch?

No, but as mentioned, _if_ you care about remembering where you _started_ the branch, you may want to tag that.

Of course, most of the time you really really don't care. It will be largely obvious from the global commit history, which you can trivially visualize with "gitk --all". You'll see where your branch "split off" the main branch, and the only case where that is ambiguous is if you started your branch at the tip of another branch, and no other development has gone on in that other branch - then you don't see a "fork".

Of course, the other reason you usually don't care where you started is that you simply don't care. When you use CVS, you usually need to know where the branch was started (and each point it was merged at) just so that you can sanely merge it by doing diffs etc. With git, since we have all the proper history, that's not necessary at all.

So I _suspect_ that most of the time when you create a branch, you don't need to tag where you started. Others will see what is your development simply by virtue of it being in your tree and not in other peoples tree, whether you created a branch for that or not ;)

		Linus
Previous: Marc SingerNext: Marc Singer
Message 13 of 33 in “Bootstrapping into git, commit gripes at me”
  1. Marc SingerJul 8, 2005
  2. Linus TorvaldsJul 9, 2005
  3. Marc SingerJul 11, 2005
  4. Junio C HamanoJul 11, 2005
  5. Junio C HamanoJul 11, 2005
  6. Linus TorvaldsJul 12, 2005
  7. Linus TorvaldsJul 12, 2005
  8. Marc SingerJul 12, 2005
  9. Linus TorvaldsJul 12, 2005
  10. Linus TorvaldsJul 12, 2005
  11. Linus TorvaldsJul 12, 2005
  12. Marc SingerJul 12, 2005
  13. Linus TorvaldsJul 12, 2005
  14. Marc SingerJul 12, 2005
  15. Petr BaudisJul 12, 2005
  16. Junio C HamanoJul 12, 2005
  17. Matthias UrlichsJul 12, 2005
  18. Petr BaudisJul 24, 2005
  19. Junio C HamanoJul 24, 2005
  20. Linus TorvaldsJul 12, 2005
  21. Petr BaudisAug 12, 2005
  22. Junio C HamanoJul 12, 2005
  23. Linus TorvaldsJul 12, 2005
  24. Junio C HamanoJul 12, 2005
  25. Linus TorvaldsJul 12, 2005
  26. Marc SingerJul 12, 2005
  27. Daniel BarkalowJul 12, 2005
  28. Linus TorvaldsJul 11, 2005
  29. Marc SingerJul 9, 2005
  30. Matthias UrlichsJul 9, 2005
  31. Petr BaudisJul 10, 2005
  32. Marc SingerJul 9, 2005
  33. Junio C HamanoJul 9, 2005

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.