I know that I can use git rev-list --count master
to get the number of commits on the specified branch - I use this to add a build number to the apps I release.
Is there a nice way in git to use that number to checkout a specific commit i.e. something like git checkout 45 master
, which would checkout the 45th commit on the master branch?