ifnull
9/5/2013 - 9:41 PM

Git Cheatsheet

Git Cheatsheet

Git Cheatsheet

Current commit hash
git log -1 --format="%H"

Current tag
git describe --always --tag --abbrev=0

Current branch
git describe --contains --all HEAD

Get tag's hash
git rev-list v1.0.0 | head -n 1

Get tags with hashes
git show-ref --tags

Get remote tags
git fetch --tags

Validate the existance of a tag
git show-ref --tags --verify "refs/tags/v1.0.0"

Machine readable status
git status --porcelain

Simple status
git status -sb