git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Shumkin <alex.crezoff@gmail.com>
To: photoshop_nerd <JBreuer@consumercredit.com>
Cc: git@vger.kernel.org
Subject: Re: checking out later commits from rolled back state
Date: Tue, 1 Nov 2011 18:56:26 +0400	[thread overview]
Message-ID: <20111101185626.6e16326c@zappedws> (raw)
In-Reply-To: <1320158207959-6951892.post@n2.nabble.com>

usually, before you checkout a "past" commit you are on a "current"
named branch
so, do
$ git log <branch_you_were_on_before>

In general, most "history" git commands take a commit hash as an
argument and HEAD as a default one if none was specified
(HEAD is always CURRENT commit (you are on), it is a difference of SVN)

when you ran
$ git log
it was, actually, 
$ git log HEAD

Also, you may specify several commits as arguments of git log
It it very usefull to use (in terminal) to see how branches are diverged
(on X/Windows gitk is more pretty)
$ git log --oneline --graph --decorate <branch1> <branch2> <branchN>


There is also  "git reflog" command
RTM git-reflog

> Hello, I a m relatively new to git, and my question pertains to
> moving back and forth through the history of my commits.
> 
> Here is how I open a previous commit:
> 
> 1)$ git log
> 
> 2) (get sha1 hash of previous commit)
> 
> 3)$ git checkout <hash of my previous commit>
> 
> the problem is that once I am working with that commit, git log only
> shows the hash tags up to the time that the commit was made, but not
> any of the later commits. Is there a way to get the hash tags of my
> later commits when I am in that rolled back state?
> 
> --
> View this message in context:
> http://git.661346.n2.nabble.com/checking-out-later-commits-from-rolled-back-state-tp6951892p6951892.html
> Sent from the git mailing list archive at Nabble.com.

  reply	other threads:[~2011-11-01 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 14:36 checking out later commits from rolled back state photoshop_nerd
2011-11-01 14:56 ` Alexey Shumkin [this message]
2011-11-01 14:58 ` Vincent van Ravesteijn

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=20111101185626.6e16326c@zappedws \
    --to=alex.crezoff@gmail.com \
    --cc=JBreuer@consumercredit.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).