Skip to content

Instantly share code, notes, and snippets.

@devth
Last active September 30, 2015 03:18
Show Gist options
  • Save devth/1713013 to your computer and use it in GitHub Desktop.
Save devth/1713013 to your computer and use it in GitHub Desktop.
# generate commit-n - dummy timestamp commits for git testing
function gcn() {
for (( i=1; i<= $1; i++ ))
do
let rand=$RANDOM
echo `date` "--" $rand >> timestamp
git add -A
git commit -m "Generate a commit at `date` with $rand"
sleep .3 # Sleep in order to add some variance to date command
done
}
# Git Aliases
alias gitr='cd `git root`'
alias gpr='git pull --rebase && git --no-pager hist @{1}..'
alias gpom='git push origin master'
alias gs="git status"
alias gp="git push"
alias gd="git diff"
alias gl="git log"
alias gk="gitx"
alias gca="git commit -am "
alias today="git today"
alias gt="git today"
alias week="git week"
alias 2days="git hist --since=2.days.ago"
alias 3days="git hist --since=3.days.ago"
alias gcod="git checkout develop"
# Git with the hub gem
alias hb="hub browse"
# Git functions
function gco(){ git checkout $@ }
function gka(){ gk --all $(git log -g --format="%h" -50) "$@"; }
# Generate git ignore from svn ignore
alias gsi="git svn show-ignore > .gitignore"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment