# tagging git tag # list available tags git tag -l v1.4.2.* # search for specific tags git tag -a v1.4 -m 'version 1.4' # create an annotated tag git tag -a v1.2 9fceb02 # tag a specific commit (if you forgot) git show v1.4 # show the tag data of a specific tag git tag v1.4 # create a lightweight tag git push --tag # you have to explicitly push tags to remotes # show tags with creation dates git log --date-order --graph --tags --simplify-by-decoration --pretty=format:'%ai %h %d' # show remotes git remote -v git diff --word-diff git push -u origin master # sets ups tracking so that you can 'git push' without extra args git show :/^Merge # show the last commit whose message matches a regex git reset --hard HEAD # reset to latest of current branch git reset --hard 0c6de32 # reset to specific commit git clean -f # remove untracked files # create a new repo from a directory in an old repo, preserving history 1. git clone 2. cd 3. git remote rm origin 4. git filter-branch --subdirectory-filter -- --all 5. cd 6. curl -u '' https://api.github.com/user/repos -d '{"name":""}' 7. git remote add origin 8. git push origin master