Advertisement
kbmonkey

git helper functions

Jun 17th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. # helper functions for speedy git use
  2. # place in your ~/.bashrc
  3. # (or if you prefer, in ~/.bash_userrc and `source ~/.bash_userrc` from .bashrc)
  4.  
  5. gg() {
  6. command=$1
  7. case $command in
  8.     log)
  9.         # grab the days value or default to 1
  10.         days=${2-1}
  11.         git --no-pager log --pretty=format:"%ar by %an (%h):%n  %s%n" --since "$days days ago"
  12.         ;;
  13.     *)
  14.         echo -e "git helper commands:\n"
  15.         echo -e "  log <days>: pretty list of the last <days> changes."
  16.         ;;
  17. esac
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement