Skip to content

Instantly share code, notes, and snippets.

@sergio-fry
Created October 20, 2017 14:01
Show Gist options
  • Save sergio-fry/7d07dfb63948e698107e01fe88e82961 to your computer and use it in GitHub Desktop.
Save sergio-fry/7d07dfb63948e698107e01fe88e82961 to your computer and use it in GitHub Desktop.
Bash aliases. git
alias ga='git add'
alias gl='git log'
alias gb='git branch'
alias gco='git checkout'
alias gd='git diff'
alias s='gs'
alias a='ga'
alias c='gc'
# Usage:
# gc 'bug is fixed' # non-interactive mode
# gc # interactive mode
# Commit message: bug is fixed
#
function gc {
local commitmessage
if [ "" = "$1" ]; then
echo -n 'Commit message: '
commitmessage="$(ruby -e "puts gets")"
git commit -m "$commitmessage"
else
git commit -m "$1"
fi
}
alias be='bundle exec'
alias gsc='git add *; git commit -m "WIP: work in progress"'
alias gcp='gsc ; git put'
alias gip='gcp'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment