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?


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)]$ 
  • sorry ya actually the link was wrong but with right link your method did work. I tried out git show 2a89985 and it worked even git log -p 2a89985 also worked.
    – Stormvirux
    Mar 23 '14 at 11:46

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.