~/local/src/ruby/rubytesting/twitter/location_freq(master)]$ cat ~/.gitconfig [user] email = blabla@gmail.com name = Blabla Perez Garcia [color] status = auto diff = auto [merge] tool = vimdiff [alias] lg = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr %an)%Creset' --abbrev-commit --date=relative wipe = "!git reset --hard;git clean -fd" co = checkout ci = commit [core] excludesfile = /Users/casiano/.gitignore_global [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true [credential] helper = osxkeychain
Para crear un alias usamos el comando git config
. Por ejemplo:
git config --global alias.st status
Uno de mis alias favoritos es git lg
:
[~/local/src/ruby/rubytesting/twitter/twitter-test(develop)]$ git lg ccaa00f - (HEAD, master, develop) minor changes (17 minutes ago Casiano Rodriguez Leon) 41098fe - (origin/rubystyle, origin/master, test, rubystyle) transformed to a more Ruby style (6 days ago Casi fb3e662 - (origin/javastyle, javastyle) instructions (6 days ago Casiano Rodriguez Leon) ea79bc3 - more instructions (6 days ago Casiano Rodriguez Leon) 9b469b1 - added template for configure.rb (6 days ago Casiano Rodriguez Leon) 87d8a07 - un cambio (7 days ago Casiano Rodriguez Leon)