Skip to content

Instantly share code, notes, and snippets.

@Hemant-Mann
Last active November 7, 2016 05:21
Show Gist options
  • Save Hemant-Mann/90feae8b24a74ba21d61 to your computer and use it in GitHub Desktop.
Save Hemant-Mann/90feae8b24a74ba21d61 to your computer and use it in GitHub Desktop.
Just enter the message for commit and it will commit to master
#!/bin/bash
if [[ ! -d .git ]]; then
echo "Fatal error: not a git repository"
exit 1
fi
if [[ $# < 1 ]]; then
git status
exit 1
fi
git add --all
git commit -m "$1"
output=$(git remote -v)
if [[ $output ]]; then
git push -u origin master
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment