Skip to content

Instantly share code, notes, and snippets.

@rodrigomaia
Created June 28, 2012 16:23
Show Gist options
  • Select an option

  • Save rodrigomaia/3012281 to your computer and use it in GitHub Desktop.

Select an option

Save rodrigomaia/3012281 to your computer and use it in GitHub Desktop.
My Git configs (hack, commits, sink, ship)
.bashrc, .bash_profile, .zshrc
alias status='git status'
alias logdiff='git log -p'
alias log='git log --decorate'
alias pull='git pull'
alias push='git push'
alias commit='git commit'
alias add='git add'
alias checkout='git checkout'
alias branch='git branch'
alias stash='git stash'
alias diff='git diff'
.rvmrc
alias hack='../scripts/hack'
alias commits='../scripts/commit'
alias sink='../scripts/sink'
alias ship='../scripts/ship'
----- hack ----
#!/bin/sh -x
FEATURE=$1
CURRENT=`git branch | grep "*" | awk '{print $2}'`
USER=`git config user.login`
git checkout $CURRENT
git pull --rebase origin $CURRENT
git checkout -b $1 $CURRENT
URL="https://api.github.com/repos/rodrigomaia/sorteando/issues/${FEATURE}"
curl -v -X PATCH -H "Accept: application/json" -H "Content-type: application/json" -u "${USER}" -d "{\"assignee\":\"${USER}\"}" $URL
---- commit ----
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git commit -a -m "[$2 #${CURRENT}] $1"
---- sink ----
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
BRANCH=$1
git checkout ${BRANCH}
git pull --rebase origin ${BRANCH}
git checkout ${CURRENT}
git rebase ${BRANCH} ${CURRENT}
---- ship ----
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
BRANCH=$1
git checkout ${BRANCH}
git merge ${CURRENT}
git commit -a -v
git push origin ${BRANCH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment