문제

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

Thanks!

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top