Skip to content

Instantly share code, notes, and snippets.

@blinkinglight
Last active September 26, 2020 16:13
Show Gist options
  • Save blinkinglight/e60e6ab64a61f7fd4fa7f97aa99d5398 to your computer and use it in GitHub Desktop.
Save blinkinglight/e60e6ab64a61f7fd4fa7f97aa99d5398 to your computer and use it in GitHub Desktop.
git fetch branch and reset its contents
worker.bash /var/www/html/project1 devel
#!/bin/bash
while true; do
cd $1
git fetch origin $2
git reset --hard FETCH_HEAD
sleep 10;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment