6

I want to find commit 2a89985 in this Project in Github. I want to find out how to access a commit If I know the commit number? Since it is a big project there seems to be a lot of commits. Is it possible to access it from terminal?

Stormvirux
  • 1,063

2 Answers2

2

You can checkout a specific commit:

git checkout 2a89985

This will put you in a detached head state though.

If you want to have a new branch on specific commit, then you can do it like this:

git branch branchname <sha1-of-commit>

In your case:

git branch newbranch 2a89985
ek9
  • 3,455
1

If you want web access to the commit without checking it out (like eedvinas.me suggested), you can access it directly by the url https://github.com/<user>/<project>/commit/<full commit hash>, e.g.: https://github.com/Schischu/ptxdist_sh/commit/43135d7f4575a415dc7811bad540b3f0439a303f.

However, the commit you're referencing, 2a89985, does not exist in this project:

[amureini@amureini ptxdist_sh (master)]$ git show 2a89985
fatal: ambiguous argument '2a89985': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
[amureini@amureini ptxdist_sh (master)]$ 
Mureinik
  • 4,152