Skip to content

Instantly share code, notes, and snippets.

@rajbos
Created January 21, 2021 18:57
Show Gist options
  • Save rajbos/6d0f3206bdc6d5872f4b4960a93a2b3a to your computer and use it in GitHub Desktop.
Save rajbos/6d0f3206bdc6d5872f4b4960a93a2b3a to your computer and use it in GitHub Desktop.
Update repo from upstream
# clone the forked repo
git clone https://github.com/rajbos/a-forked-repo.git
# make sure you are inside the git repo
cd a-forked-repo
# add the parent repo as a remote
git remote add github-parent $parentUrl
# fetch the changes from the parent
git fetch github-parent
# make sure you are on the right branch
git checkout main
# merge in any changes from the branch
git merge github-parent/main
# push the changes back to your repo
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment