Created
November 28, 2013 09:00
-
-
Save sachitsac/7689043 to your computer and use it in GitHub Desktop.
Git Pull and Push in one line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 3 ] | |
then | |
echo -e "Usage gitpush [remote_branch] [branch_name] [commit_message]" | |
echo -e "eg: gitpush origin master 'Some commit message'" | |
exit | |
fi | |
git add . | |
git commit -m "$2" | |
git pull $1 $2 && git push $1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment