Skip to content

Instantly share code, notes, and snippets.

@Elijas
Last active November 25, 2020 04:46
Show Gist options
  • Save Elijas/895544cef2a89e22d8364a6a5ef32567 to your computer and use it in GitHub Desktop.
Save Elijas/895544cef2a89e22d8364a6a5ef32567 to your computer and use it in GitHub Desktop.
Pull upstream changes
#!/bin/bash -xe
UPSTREAM_REPO_URL=...
git remote add upstream "$UPSTREAM_REPO_URL" || true
git pull origin main
git checkout main
git fetch upstream
git merge upstream/main
git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment