Skip to content

Instantly share code, notes, and snippets.

@ackinc
Last active May 17, 2021 10:04
Show Gist options
  • Save ackinc/a3f7f4644255e8a87edd743b01e35a54 to your computer and use it in GitHub Desktop.
Save ackinc/a3f7f4644255e8a87edd743b01e35a54 to your computer and use it in GitHub Desktop.
# git shortcuts
alias gits='git status'
alias gitb='git branch'
alias glog='git log --graph --oneline --decorate'
alias gco='git checkout'
alias gcd='git checkout dev'
alias gcdev='git checkout dev'
alias gcs='git checkout staging'
alias gcm='git checkout master'
alias gcmn='git checkout main'
alias gcmain='git checkout main'
alias gca='git commit --amend'
alias gitp='git push'
alias gitpt='git push --tags'
alias gitpf='git push --force'
# push current branch to remote, setting up a tracking branch with the same name
# if remote is not specified, 'origin' is assumed
gitpu() {
if [ -n "$1" ]; then remote="$1"; else remote='origin'; fi
git push --set-upstream "$remote" `git branch | grep \* | cut -d" " -f2`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment