Skip to content

Use Github to clone another branch from a remote repo into my clone of that repo #61556

Discussion options

You must be logged in to vote

I've been a contributor to a project XYZ for a while. I have cloned the main branch of the XYZ repo to my Github account, and make edits and PRs to contribute back. (I don't have write access to the XYZ repo.)

Someone created a new branch new-branch of the XYZ repo. How can I clone/pull/get that branch into my repo? I have not yet found a way to do this through the Github web GUI. Many thanks

  • Delete the forked repo
  • fork the repo again & make sure to uncheck copy the main branch only
  • After that clone the forked repo to your local system
  • Use git branch --all command to check all branches
  • now switch branch using the command git switch branch_name

Hope it will help you

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@richb-hanover
Comment options

Answer selected by richb-hanover
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 New User Help ❓ New User help Programming Help Programming languages, open source, and software development.
3 participants