git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bill lam <cbill.lam@gmail.com>
To: git <git@vger.kernel.org>
Subject: checkout to a reflog entry
Date: Tue, 25 Aug 2009 12:52:35 +0800	[thread overview]
Message-ID: <20090825045235.GB391@debian.b2j> (raw)

Sometimes when git reflog and try to checkout to a previous commit, 

project((6a33dbc...))$ git reflog show master
77aa688 master@{0}: rebase -i (finish): refs/heads/master onto fc3eaa4
6a33dbc master@{1}: commit: wip
.....


project(master)$ git checkout master@{1}
Note: moving to 'master@{1}' which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 6a33dbc... wip
project((6a33dbc...))$ 

project((6a33dbc...))$ git branch
* (no branch)
  master

It becomes (no branch) although the SHA1 is correct. If I then checkout master,
then it revert and jump back up the previous master HEAD.  I tried HEAD@{xx}
also failed.  What is the correct way of to checkout that master@{..} and stay
in that master branch?  (Sometimes it worked I forgot how and why)

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

             reply	other threads:[~2009-08-25  4:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25  4:52 bill lam [this message]
2009-08-25  5:22 ` checkout to a reflog entry Jeff King
2009-08-25  5:37   ` bill lam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090825045235.GB391@debian.b2j \
    --to=cbill.lam@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).