Skip to content

Instantly share code, notes, and snippets.

@akashnimare
Created June 19, 2016 16:08
Show Gist options
  • Save akashnimare/5bc9a1afd29ac07a5a95198037297ed5 to your computer and use it in GitHub Desktop.
Save akashnimare/5bc9a1afd29ac07a5a95198037297ed5 to your computer and use it in GitHub Desktop.
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment