Last active
January 9, 2016 21:10
-
-
Save AvnerCohen/a25a69df4e13f469c4ee to your computer and use it in GitHub Desktop.
Random Git aliases and commands to
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
# Command: GLOG | |
# Description: alias that creates a nice and easy on eye history log with graph indication of merge commits and branches | |
git config --global alias.glog "\!git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative ; true" | |
# Run: | |
git glog | |
# Command: LASTWORKS | |
# Description: Lists the last 10 branches you worked on | |
git config --global alias.lastworks "for-each-ref --count=10 --sort=-committerdate refs/heads/" | |
# Run: | |
git lastworks | |
# Command: Shortcuts | |
# Description: aliases for common commands to save on keystorkes | |
git config --global alias.co checkout | |
git config --global alias.pl "pull -r" | |
git config --global alias.st status | |
# Run: | |
git co .. | |
#Command: "Sorted Tags" | |
# Description: listing tas is ordered by name, which does not always makes sense, `stags` displays the tags sorted by creation date | |
git config --global alias.stags "\!git for-each-ref --format='%(*committerdate:raw)%(committerdate:raw) %(refname) %(*objectname) %(objectname)' refs/tags | sort -n | cut -d'/' -f 3 | cut -d' ' -f 1" | |
# Run: | |
git stags | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment