From: Junio C Hamano Date: Tue, 14 Feb 2006 19:13:44 GMT Subject: Re: several quick questions Message-ID: <7vy80drbx3.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <87k6bxvmj6.wl%cworth@cworth.org> Carl Worth writes: > 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 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 # do interesting things $ git reset --hard # do interesting things $ git reset --hard # ... $ git reset --hard # do interesting things # once you are done $ git checkout master $ git branch -D temp