天天看点

git 下载跟踪远程分支

当使用git下载源码后,使用git branch -a可以看到很多远程分支 比如remotes/origin/xxxx

怎么使用某一个远程分支呢,命令

git checkout - t -b local_branch_name remotes/origin/xxxxx

这样就使本地分支local_branch_name同步到远程分支remotes/origin/xxxxx上了,请且切换到了local_branch_name分支上