docbrown/scripts/sync_fork.sh
Ridhwana 813389d36a
Keeping your forked branch up to date (#6531)
* chore: updates to sync your forked ranch

* chore: use rease instead

* feat: update the script to not bomb out if you have added the remote before

* chore: add the comment back
2020-03-09 09:37:46 -04:00

12 lines
307 B
Bash
Executable file

#!/bin/sh
set -e
# sync this fork with upstream to get the latest changes
URL="https://github.com/thepracticaldev/dev.to";
if ! git config remote.upstream.url > /dev/null; then
echo "Adding remote ${URL}"
git remote add upstream $URL
fi
git fetch upstream
git checkout master
git merge upstream/master