Created
May 17, 2013 12:58
-
-
Save bulv1ne/5598865 to your computer and use it in GitHub Desktop.
My lazy way to commit and push at a remote server
This file contains 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/bash | |
# Get directory of project where this script is | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# Go to directory | |
cd $DIR | |
# Get the remote SSH command | |
SSH="$( git remote -v | grep live | grep push | awk '{ print $2; }' | cut -f1 -d":" )" | |
# Do the command as root over ssh | |
ssh -t $SSH "cd $DIR; sql/sqlbackup.sh && git add . && git commit -a -m 'Puppy' && git push" | |
# Get the data | |
git pull live |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment