Re: git branch --switch?
- From
Brian Gernhardt <benji@silverinsanity.com>
- Date
- Apr 17, 2007, 14:46 UTC
- Message-ID
- <F47212AE-B31D-4025-9859-6794E7405DF2@silverinsanity.com>
- In-Reply-To
- <81b0412b0704170721i2b64999aqbd0d7489074454d6@mail.gmail.com>
On Apr 17, 2007, at 10:21 AM, Alex Riesen wrote:
Show 5 quoted lines
> Kind of. It can be done with git-read-tree. I.e.: > > $ git-read-tree --index-output=.git/tmp-index <branch-name> && \ > mv tmp-index .git/index && \ > git update-ref HEAD <branch-name>
This does not appear to do what you think it will. git update-ref will write the SHA1 of <branch-name> into the current HEAD, not switch HEAD to a new branch.
However, the first two lines will correctly update the index to the new head which is probably a good idea.
~~ Brian