Git Cheat Sheet (Fork Repo)

michelletanpy

Michelle Tan

Posted on August 22, 2020

Git Cheat Sheet (Fork Repo)

Here's a little cheat sheet for fork repo.

Track original repository

It's best to set this after you clone your fork.

# Set fork to track original repo
git remote add upstream https://github.com/[Original Owner]/[Original Repository].git
Enter fullscreen mode Exit fullscreen mode

Update your fork

# Sync your fork with original repo
git fetch upstream
git checkout master
git merge upstream/master
git push origin master
Enter fullscreen mode Exit fullscreen mode

Check your remote fork setup

git remote -v
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
michelletanpy
Michelle Tan

Posted on August 22, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Github and Git Workflow
github Github and Git Workflow

October 13, 2024

A Beginner’s Guide to GitHub
github A Beginner’s Guide to GitHub

October 19, 2024

Complete Git Cheat sheet
webdev Complete Git Cheat sheet

September 25, 2024

Forks in GitHub
git Forks in GitHub

September 19, 2024