DEV Community

loading...
Cover image for Git Cheat Sheet (Fork Repo)

Git Cheat Sheet (Fork Repo)

Michelle Tan
My name is Michelle and I'm a software engineer. Iā€™m currently coding in C# most of my time. Learning Flutter and Python on the side. Thoughts and opinion are of my own.
惻Updated on 惻1 min read

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

Discussion (0)