Skip to content

Instantly share code, notes, and snippets.

@robertpostill
Last active May 12, 2019 09:30
Show Gist options
  • Save robertpostill/1c9352b42360ed04b02fa6235f3c2ad2 to your computer and use it in GitHub Desktop.
Save robertpostill/1c9352b42360ed04b02fa6235f3c2ad2 to your computer and use it in GitHub Desktop.
git update script
#!/bin/sh
#
# Go and get the latest from git
# Where the git repo is, optionally could be set from outside ENV? Not sure how that would work in anacron
GIT_DIR=<put your code location here>
# if git dir exists update it otherwise exit with a bad status
cd $GIT_DIR
# no hacks please
git reset
#execute command
git pull origin release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment