Skip to content

Instantly share code, notes, and snippets.

@mathew-fleisch
Created December 18, 2018 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathew-fleisch/f47568a665dd301791aec10f24419f60 to your computer and use it in GitHub Desktop.
Save mathew-fleisch/f47568a665dd301791aec10f24419f60 to your computer and use it in GitHub Desktop.
Update repo
# Standard
*/5 * * * * cd /path/to/repo && git pull origin master
# Overwrite all changes with master
*/5 * * * * cd /path/to/repo && git fetch --all && git reset --hard origin/master
# Pull changes, but persist local changes (i.e. config that is not checked into repo)
*/5 * * * * cd /path/to/repo && git stash && git pull origin master && git stash pop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment