Skip to content

Instantly share code, notes, and snippets.

@aalonzolu
Last active September 26, 2017 17:48
Show Gist options
  • Save aalonzolu/6550e64173297a407056445e2427d5e6 to your computer and use it in GitHub Desktop.
Save aalonzolu/6550e64173297a407056445e2427d5e6 to your computer and use it in GitHub Desktop.
gitpush function, send to git in one line.
#INSTALL
#Put this function on your .bashrc or /etc/profile or .profile (in macOS)
#USAGE
# gitpush <branch> "commit comment"
gitpush(){
if [[ $# -eq 0 ]] ; then
echo "arguments needed";
fi
if [[ $# -eq 2 ]] ; then
git pull origin $1 --no-edit ;
git add .;
git commit -m "$2";
git push origin $1;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment