How to view branch of a forked repository into my local repository?

1.4k views Asked by At

I have a private repository which someone forked. He created a branch in his forked repository, made some changes, and created a pull request back to the original repository which is owned by me.

I can see his Pull request as well as the branch in my PR section. I have a clone of my repository in my local machine and I want to pull that branch into my local and make some changes to it.

I don't know how to do it. Can someone help?

P.s.: I cannot find his branch when I do -> git branch or ```git branch -R``

1

There are 1 answers

2
Sajib Khan On

You should add a remote (e.g. 'forked') with the forked repo's URL.
Then you need to fetch forked repo's branches to see that branch!

$ git remote add forked <forked_repo_url>

$ git fetch forked

$ git branch --all
# should see a branch like remotes/forked/<branch_name>