sync local updates with remote git clone via single command
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/sh | |
########################### | |
cd /c/dev/psy-blog.git | |
# pushing committed updates first | |
git push | |
# standard procedure | |
git add . | |
echo type message.. | |
read commitMessage | |
git commit -am "$commitMessage" | |
# push to git remote repository | |
git push ssh://ubuntu@127.0.0.1:/var/git/blog.git | |
# pull at remote server | |
ssh ubuntu@127.0.0.1 "sudo sh -c 'cd /var/www/html && /usr/bin/git pull'" | |
########################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment