Skip to content
Discussion options

You must be logged in to vote

Branch: Use it when you have write access to the repo (your own project or a team repo). Create feature/login, work, and open a PR into main.
Fork: Use it when you don’t have write access, as in most open-source contributions. A fork is your own copy of someone else’s repo, where you push branches and then open a PR back to the original.

Keeping a fork in sync:

On GitHub, click Sync fork on your fork’s page, or
From the command line:
bash
git remote add upstream https://github.com/ORIGINAL/REPO.git
git fetch upstream
git checkout main
git merge upstream/main # or: git rebase upstream/main
git push origin main

Always create a new branch from an up-to-date main for each contribution.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Nova-Developer18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage Question Ask and answer questions about GitHub features and usage source:ui Discussions created via Community GitHub templates
2 participants