Last active
August 29, 2015 13:58
-
-
Save timbru31/10369190 to your computer and use it in GitHub Desktop.
Git Add & Commit & Push :)
This file contains hidden or 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/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 |
This file contains hidden or 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/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