Skip to content

Instantly share code, notes, and snippets.

@timbru31

timbru31/git-acp.sh

Last active Aug 29, 2015
Embed
What would you like to do?
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