Skip to content

Instantly share code, notes, and snippets.

@sangpt
Last active December 25, 2017 03:24
Show Gist options
  • Save sangpt/6d2181aef0cfc25c8be66d682be2c20c to your computer and use it in GitHub Desktop.
Save sangpt/6d2181aef0cfc25c8be66d682be2c20c to your computer and use it in GitHub Desktop.
# customize
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}
alias tt='/var/toggle-touchpad'
alias r='rails'
alias gc='git commit -m'
alias gca='git add .;git commit --amend --no-edit'
alias gst='git status'
alias glo='git log --oneline'
alias gco='git checkout'
alias gcp='gca; git push -f origin $(git_branch)'
alias gpf='current=$(git_branch); git checkout develop; git pull framgia develop; git checkout $current'
alias grh='git reset --hard HEAD'
alias gpc='git push -f origin $(git_branch)'
alias gcam='git commit --amend'
alias gpfgrd='gpf; git rebase develop'
alias grd='git rebase develop'
alias ga='git add .'
@sangpt
Copy link
Author

sangpt commented Sep 22, 2017

Show git branch on terminal and alias some command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment