Last active
June 21, 2016 03:04
-
-
Save shayanbo/63a5f0ae65148ca00bacc9f992a6c9c3 to your computer and use it in GitHub Desktop.
Get commit SHA1 with commit count from some branch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# get commit SHA1 with commit count. | |
commitCount=5648 | |
branch='HEAD' | |
ruby -e 'puts `git rev-list #{branch}`.split.reverse[#{commitCount}-1]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment