githubteacher / github-for-developers-sept-2015

practice repo for the Sept 29-30 GitHub for Developers class
12 stars 36 forks source link

Shortcut for entering git commit sha hash #711

Closed saranicole closed 8 years ago

saranicole commented 8 years ago

It looks like Patrick is copying the sha hash for a commit over to the next line. I see there is a way to specify a commit using shorthands ( http://superuser.com/questions/464716/when-checkout-a-previous-commit-is-there-a-quick-way-to-input-the-log-commit-ha ).

Is there a way to autocomplete the sha hash itself ( rather than use the shorthand ) ?

jaw6 commented 8 years ago

I'm sure it's possible, but the specifics would vary a bit depending on shell, operating system, etc. One thing to keep in mind, is that you only need the minimum number of characters to uniquely identify the SHA in your repository. In small repositories, three characters is sometimes specific enough -- when it isn't, git will indicate that the SHA was "ambiguous". I typically use 5-8 characters (this scales up to several thousand commits).

saranicole commented 8 years ago

@jaw6 Okey doke - thanks!