Skip to content

Instantly share code, notes, and snippets.

@sachitsac
Created November 28, 2013 09:00
Show Gist options
  • Save sachitsac/7689043 to your computer and use it in GitHub Desktop.
Save sachitsac/7689043 to your computer and use it in GitHub Desktop.
Git Pull and Push in one line
#!/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