Skip to content

Instantly share code, notes, and snippets.

@iamntz
Created September 13, 2013 06:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamntz/6547351 to your computer and use it in GitHub Desktop.
Save iamntz/6547351 to your computer and use it in GitHub Desktop.
Usage: add these lines in your `~/.gitconfig` file (in Windows you can press win+r and type %home% to open the right folder). The, in terminal, you could do `git lol` to see a nicely formatted log or `git zip` to quickly zip current branch and so on.
[alias]
lol = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %C(black bold)- %an %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
hash = rev-parse --short HEAD
curbranch = "!git branch | grep \"*\" | sed \"s/* //\""
zip = "!HASH=$(git hash) && BRANCH=$(git curbranch) && git archive --format zip --output $BRANCH-$HASH.zip master"
pu = "!git push origin $(git curbranch) --progress" ; TODO: add a parameter to allow stuff like `git pu custom-remote-name`
pp = "!git pull origin $(git curbranch)"
la = "!git config -l | grep alias | cut -c 7-" ; just in case you forget an alias ;)
ignore = "!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore" ; quickly ignore a file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment