Skip to content

Instantly share code, notes, and snippets.

@tgrecojs
Last active June 28, 2021 05:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgrecojs/eb6f480b6f029a198e1aaac3df6b170c to your computer and use it in GitHub Desktop.
Save tgrecojs/eb6f480b6f029a198e1aaac3df6b170c to your computer and use it in GitHub Desktop.
#https://egghead.io/lessons/javascript-how-to-fork-and-clone-a-github-repository
# Step 1 - Fork Repo want to work with & clone it to your machine.
git clone https://github.com/tgrecojs/example-repo
# cd into repo
cd example-repo
# Add upstream branch
git remote add upstream https://github.com/<repoOwner>/example-repo
# fetch upstream branches
git fetch upstream
# Point master branch of forked repo to the upstream repo's master branch
# ex. of upstream/main being the target branch we wish to stay in sync ith
git branch --set-upstream-to=upstream/main main
# ex. upstream/master is the target branch we wish to stay in sync ith
git branch --set-upstream-to=upstream/master master
## finally, sync repo from upstream branch
git pull upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment