Timetraveling with GIT

or checking out a specific commit.

First, one has to locate the hash of the commit. This can be done by:

  1. Scanning the log by running “git log” (press q to quit). Look for lines labeled commit.
  2. Scanning the log in giggle. Look for the SHA-line. Example:
    Screenshot of Giggle, click to enlarge

In this case our hash is 7f8d2051582dd030e3c07ded70010af033461e31.

Then, come up with a name for a branch to refer the this specific revision. For this example we will use old-branch.

Last, set up the branch by running:

git checkout -b old-branch 7f8d2051582dd030e3c07ded70010af033461e31

Syntax: The general syntax is: “git checkout -b BRANCHNAME HASH

Advertisements

Tags: , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: