Re: several quick questions
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 14, 2006, 19:13 UTC
- Message-ID
- <7vy80drbx3.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <87k6bxvmj6.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 9 quoted lines
> 2) Ensure that bogus-branch exists somewhere (don't care where), then > move it: > > # Create the branch (if it doesn't exist) > git checkout -b bogus-branch >& /dev/null > # Switch to it (which doesn't happen above if it already existed) > git checkout bogus-branch > # Move the branch to the revision of interest > git reset --hard <revision>
For moving around in history (like cg-seek if I understand correctly), the above is the right and probably most efficient way to do with the core-git tools.
# setup
$ git branch -f temp ;# make sure it exists
$ git checkout temp ;# and switch to it
# repeatedly...
$ git reset --hard <revision1>
# do interesting things
$ git reset --hard <revision2>
# do interesting things
$ git reset --hard <revision3>
# ...
$ git reset --hard <revisionn>
# do interesting things
# once you are done
$ git checkout master
$ git branch -D temp