Skip to content

Instantly share code, notes, and snippets.

@hearsid
Created September 21, 2015 09:00
Show Gist options
  • Save hearsid/ed325a1586f2e2340936 to your computer and use it in GitHub Desktop.
Save hearsid/ed325a1586f2e2340936 to your computer and use it in GitHub Desktop.
Bash script to easily deploy the code from your local machine to bitbucket , and then login to the server and download the updated code from bitbucket to your server .
#!/bin/bash
git add --all
git commit -m "committing all changes"
git push origin master
ssh -t -t [email protected] << EOF
pwd
cd /var/www/html/my-app/
pwd
git fetch
git reset --hard origin/master
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment