akashnimare
6/19/2016 - 4:08 PM

From http://paolo.fr/

function commit() {
  local b
  local r

  b=$(git rev-parse --abbrev-ref HEAD)
  r=$(git remote)

  read -e -p "Message:" msg
  read -e -p "Branch [${b}]:" branch
  read -e -p "Remote [${r}]:" remote

  if [[ -z "$msg" ]]; then
    msg="Update..."
  fi

  if [[ -z "$branch" ]]; then
    branch=$b
  fi

  if [[ -z "$remote" ]]; then
    remote=$r
  fi

  {
    git add -A .
    git commit -m "$msg"
    git push $remote $branch
  } > /dev/null
}