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