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

Re: nicer frontend to get rebased tree?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 22, 2008, 20:33 UTC
Message-ID
<alpine.LFD.1.10.0808221330090.3487@nehalem.linux-foundation.org>
In-Reply-To
<4d8e3fd30808221311w7c507abboecd0893def85a073@mail.gmail.com>
On Fri, 22 Aug 2008, Paolo Ciarrocchi wrote:
Show 8 quoted lines
> 
> since tip/master is often rebased (as pu or linux-next) what I do is
> the following:
> git branch -D tip-latest
> git checkout -b tip-latest tip/master
> 
> but I guess lot of people would expect to "throw away" and "checkout
> again" with a single git command.

I would literally suggest not using a branch at all. Yes, it works, but this is the perfect usage case for "no branch" aka "detached head" usage, because "git status" will nicely tell you "Not currently on any branch" and "git branch" will point it out too.

So instead of using a real branch "tip-latest", just do
	git checkout tip/master

to not create a branch at all, since all you will eventually have to do is to delete it anyway, and saving the state for later would be actively wrong.

The "git checkout" will also have a nice message like
	Note: moving to "tip/master" which isn't a local branch

and about how you _can_ save the state later if you want to (even if you don't), which may look a bit scary, but once you get used to it it's actually not scary at all, but just reminds you that you did the right thing.

		Linus
Previous: Paolo CiarrocchiNext: Björn Steinbrink
Message 6 of 42 in “nicer frontend to get rebased tree?”
  1. Andi KleenAug 22, 2008
  2. Linus TorvaldsAug 22, 2008
  3. Andi KleenAug 22, 2008
  4. Linus TorvaldsAug 22, 2008
  5. Paolo CiarrocchiAug 22, 2008
  6. Linus TorvaldsAug 22, 2008
  7. Björn SteinbrinkAug 22, 2008
  8. Paolo CiarrocchiAug 22, 2008
  9. Linus TorvaldsAug 22, 2008
  10. Junio C HamanoAug 22, 2008
  11. Andi KleenAug 23, 2008
  12. Paolo BonziniAug 23, 2008
  13. Andi KleenAug 23, 2008
  14. Paolo BonziniAug 23, 2008
  15. Linus TorvaldsAug 23, 2008
  16. Andi KleenAug 23, 2008
  17. Linus TorvaldsAug 23, 2008
  18. Ingo MolnarAug 25, 2008
  19. Björn SteinbrinkAug 23, 2008
  20. Linus TorvaldsAug 23, 2008
  21. Björn SteinbrinkAug 23, 2008
  22. Documentating branches (was: nicer frontend to get rebased tree?)Marius Vollmer, Aug 23, 2008
  23. Miklos VajnaAug 23, 2008
  24. Marius VollmerAug 23, 2008
  25. Marius VollmerAug 23, 2008
  26. Avery PennarunAug 22, 2008
  27. Andi KleenAug 22, 2008
  28. Paolo CiarrocchiAug 22, 2008
  29. Jakub NarebskiAug 22, 2008
  30. Andi KleenAug 23, 2008
  31. Paolo CiarrocchiAug 23, 2008
  32. Jakub NarebskiAug 23, 2008
  33. Andi KleenAug 23, 2008
  34. Paolo CiarrocchiAug 23, 2008
  35. Linus TorvaldsAug 23, 2008
  36. Paolo CiarrocchiAug 23, 2008
  37. Björn SteinbrinkAug 23, 2008
  38. Junio C HamanoAug 24, 2008
  39. Jakub NarebskiAug 23, 2008
  40. Theodore TsoAug 23, 2008
  41. A proposed solution (Was: nicer frontend to get rebased tree?)Theodore Tso, Aug 23, 2008
  42. Mikael MagnussonAug 22, 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.