Skip to content

How to add upstream/topic_branch to local, forked repo #23033

Discussion options

You must be logged in to vote

If you have a remote in your local repository named upstream that points to their repository and a remote named origin that points to your GitHub repository, you can do the following:

# Creates a local branch named `ABC_branch`
git checkout -b ABC_branch

Fetches the ABC_branch content from upstream and merges it into your local branch

git pull upstream ABC_branch

Then, if you want to have ABC_branch in your fork of their repository, you can use:

git push origin ABC_branch

I hope that helps!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants