How to "bookmark" a particular commit via browser?

Hi all, I am a newbie to github: using it to track changes in simple text files. I primarily use in the browser.

Is there a way to “bookmark” “star” “pin” etc a particular commit that I made in the github system? I can’t seem to find a button that does that.

I then thought that maybe the SHA was a unique identifier and I could just search for the SHA in the future. I read the help manual for how to search for a commit by SHA, but it doesn’t seem to find the commit. This is the help page I was looking at. From google I also found that the git command line can search a SHA easily, but I am not really comfortable with command line yet.

From my dashboard, I select the repository I want from the left-hand menu. When in the repository, I go to the upper left of my browser at the very top where there is a search field. I paste in the SHA I want to search, from partial to the entire long string … and the search never finds it. Am I not searching by SHA correctly? I tried entering “SHA:” prefix but that didn’t help either. The error screen says “We couldn’t find any code…” which leads me to believe that it’s looking for code content and not the SHA…

Of course this is just a tangent. Maybe you all know the best method to flag a particular commit. Thanks for any advice!

Please see attached screenshot

1 Like

Maybe you can use releases for that purpose? The general git way would be to use a tag, but I don’t see a way to create that over the web UI. Github’s releases are basically tags with some additional information (and possibly files) attached.

That’s correct, the commit hash is a unique identifier, that’s one of the core concepts of git. :slightly_smiling_face:

Searching for the hash works for me, but there are two catches:

  1. You have to search for the beginning of the hash (or the whole thing). So if the commit you’re searching for is 2d5cf4e80dcebab5e8a35e8b2c3f8a7e13697fdb searching for 2d5cf4e8 should work, but not d5cf4e8.
  2. For reasons unknown to me the results page shows only code matches (within the files in your repository) by default. You have to select “commits” on the left, note the “1” match count in the screenshot below.

1 Like

GitHub is designed to be very browser-friendly, virtually everything in GitHub is identified by a URL. If you can find a particular commit in the GitHub UI, you can use your browser’s “bookmark” feature to store the URL to get back to it. You can use this system for pretty much any object or record in the GitHub UI.

Also, if you know the commit SHA (or the first several characters of it) and the repository where the commit is from you can go directly there by typing in a URL in the form[SHA]. So, to get to the commit 3f1f001 in my test-repo repository, you could navigate to either of these URLs:

Basically, these URLs break down into:

  1. — On GitHub
  2. lee-dohm/ — In the lee-dohm account
  3. test-repo/ — In the test-repo repository
  4. commit/ — Find the commit
  5. 3f1f001 — Named 3f1f001

I hope that helps!


hm I can’t figure out how to quote sections like you did, but here’s my replies:

  1. I did think of trying to use tags, but it seems that to create a tag, it needs to be tied to a release. But when I try to select the release target, I can only choose a branch, not a specific commit point? ie, the drop down list only lets me choose from the master, or the other branches.

  2. So I did try searching the full hash. I go to the specific commit and click on the little ‘clipboard’ icon to copy the full hash. Then I go back to that search bar and paste it and search “in this repository.” Still can’t find anything. I make sure to click the “Commits” from the left-hand menu. Still no results. Does maybe search NOT work on a private repo?

HAHA! using the browser bookmarks is a great idea!! So simple I didn’t event think of that!

And I did not know about the url schema but that sounds like a great thing too. I will use that also.

Now, just to figure out why the Search isn’t working as expected…

1 Like

The drop-down should have tabs to choose “Branches” or “Recent Commits”:

If that isn’t there I suspect a bug. :sweat_smile:

Thanks for the continued advice!

You are correct; it does have the recent commits tab. Unfortunately, the one I want must not be “recent” enough to make it on the list…

1 Like

So do you guys think the Search is broken? Should I try contacting Support Staff (if any)?

No, if you want to search for commits by their hash, there are instructions in the help documentation on how to do it:

You have to precede the SHA with the qualifier hash:. So if you want to search for a272cd as in your example, then you would enter hash:a272cd in the search box.

Additionally, I am Support Staff :grinning: You can tell by the Octocat insignia over my avatar and the Staff title after my username.

1 Like

Oh cool! You are Support! Thanks!

So I tried exactly as instructions and no hits. See my screenshot

any idea why I can’t search any commit hashes succesfully?

My apologies for not responding sooner, I was on vacation last week :grinning:

Is this a public repository that I can check?