Home > Blockchain >  how to pull a branch in repository?
how to pull a branch in repository?

Time:12-29

so I have some repository, in that repo have master and other branches ( or we can call branch a, branch b, branch c)

I want to pull branch C, how can I do that?

I'm using command line and git

CodePudding user response:

You can do:

git pull origin c

then checkout the branch

git checkout c

CodePudding user response:

Try and use git switch, not the old obsolete and confusing git checkout command.

git fetch
git switch c

That is because, from guess mode:

If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote>) with a matching name, treat as equivalent to

git switch -c <branch> --track <remote>/<branch>
  • Related