Skip to content

Instantly share code, notes, and snippets.

@timbru31
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timbru31/10369190 to your computer and use it in GitHub Desktop.
Save timbru31/10369190 to your computer and use it in GitHub Desktop.
Git Add & Commit & Push :)
#!/bin/sh
line() {
echo "$(tput setaf 6)======================================================================"
}
blankLine() {
echo ""
}
echo "========================="
echo "Git: Add + Commit + Push"
echo "========================="
blankLine
git st
echo "Git add ."
git add . -A
git add -u
printf "commit description: "
read -r desc
git commit -m "$desc"
if [ $(echo $?) -ne 0 ]
then
blankLine
line
echo "$(tput sgr0)< Unable to commit..."
line
exit 1
fi
git push "$repository"
if [ $(echo $?) -ne 0 ]
then
blankLine
line
echo "$(tput sgr0)< Unable to push..."
line
exit 1
fi
blankLine
line
echo "$(tput bold ; tput setaf 5) (\___/)"
echo "$(tput bold ; tput setaf 5) (=\xE2\x80\x99.\x27=) $(tput sgr0)< Files added, committed and pushed!"
echo "$(tput bold ; tput setaf 5) (\xE2\x80\x9D)_(\xE2\x80\x9D) $(tput sgr0)"
line
#!/bin/sh
line() {
echo "$(tput setaf 6)========================================================================="
}
blankLine() {
echo ""
}
echo "==========================="
echo "Git: Add + Commit + Publish"
echo "==========================="
blankLine
git st
echo "Git add ."
git add . -A
git add -u
printf "commit description: "
read -r desc
git commit -m "$desc"
if [ $(echo $?) -ne 0 ]
then
blankLine
line
echo "$(tput sgr0)< Unable to commit..."
line
exit 1
fi
git publish master
if [ $(echo $?) -ne 0 ]
then
blankLine
line
echo "$(tput sgr0)< Unable to publish..."
line
exit 1
fi
blankLine
line
echo "$(tput bold ; tput setaf 5) (\___/)"
echo "$(tput bold ; tput setaf 5) (=\xE2\x80\x99.\x27=) $(tput sgr0)< Files added, committed and published!"
echo "$(tput bold ; tput setaf 5) (\xE2\x80\x9D)_(\xE2\x80\x9D) $(tput sgr0)"
line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment