Skip to content

Instantly share code, notes, and snippets.

@PsyChip PsyChip/sync.sh
Created Jan 10, 2018

Embed
What would you like to do?
sync local updates with remote git clone via single command
#!/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
You can’t perform that action at this time.