Skip to content

Instantly share code, notes, and snippets.

@djvs
Last active August 29, 2015 14:15
Show Gist options
  • Save djvs/10c47eb229930f2396c7 to your computer and use it in GitHub Desktop.
Save djvs/10c47eb229930f2396c7 to your computer and use it in GitHub Desktop.
push(){
git config remote.origin.url >& /dev/null
if [ $? -eq 0 ]; then
if [ $# -eq 0 ]; then
echo "you need to give a commit message! example: \n push \"my message\"" ; return
fi
git add -A :/;
git commit -a -m $1;
git push origin $(git branch | sed -n -e 's/^\* \(\.*\)/\1/p' );
else
echo "you're not in a git repo!"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment