git查兩個commit的距離
方法1
git log {old versioin}..{new version} --oneline | wc -l
方法2(較快)
git rev-list {old versioin}..{new version} --count
rev-list只印出sha1 code
例如:
git log HEAD~10..HEAD --oneline | wc -l
git rev-list HEAD~10..HEAD --count
Reference:
http://gal.steinitz.com/blog/2013/07/27/git-tips-count-number-of-commits-between-two-commits/
留言