Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何跟踪新远程存储库的主分支?_Git - Fatal编程技术网

Git 如何跟踪新远程存储库的主分支?

Git 如何跟踪新远程存储库的主分支?,git,Git,我的本地存储库中有两个远程存储库: me@desktop:~/linux$ git remote linux-next origin 当我执行git checkout linux next/master时,我会得到以下状态: me@desktop:~/linux$ git status HEAD detached at linux-next/master nothing to commit, working directory clean 如何在下一步签出第二个远程linux的主机并跟踪该

我的本地存储库中有两个远程存储库:

me@desktop:~/linux$ git remote 
linux-next
origin
当我执行
git checkout linux next/master
时,我会得到以下状态:

me@desktop:~/linux$ git status
HEAD detached at linux-next/master
nothing to commit, working directory clean
如何在下一步签出第二个远程
linux的主机并跟踪该远程设备?

您可以尝试

git branch -u Linux-next/master
如果您的git版本超过1.8