Pergunta

How does one add a local branch from that of another developer? My colleague's branch is not out on origin.

Thanks!

Foi útil?

Solução

First, add a "remote" (like a nickname for a repository URL) for your colleague's repository:

git remote add colleague <URL-of-their-repository>

Then fetch all the branches from that repository into remote tracking branches called refs/remotes/colleague/<branch-name> (which can usually be abbreviated to colleague/<branch-name>):

git fetch colleague

Now create (and switch to) a local branch called foo which tracks your colleague's branch called foo with:

git checkout --track colleague/foo
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top