关于提示:You asked to pull from the remote ‘xxx’, but did not specify a branch.

  • Post author:
  • Post category:其他




but did not specify a branch.

$git remote add xxx git@github.com:lewhy2004/test
$git pull xxx

提示如下:

You asked to pull from the remote 'xxx', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

加一个远程分支名。

$git pull xxx master

提示如下:

From github.com:lewhy2004/test
 * branch            master     -> FETCH_HEAD

pull成功执行!默认本地分支为master。

再加一个本地分支名。

$git pull xxx master:test

提示如下:

From github.com:lewhy2004/test
 * [new branch]      master     -> test

pull成功执行!新建一个本地分支test来存放。



有点不明白的地方

敲入如下命令:

$git pull  git@github.com:lewhy2004/test

没有指定远程分支,却能运行通过。

From github.com:lewhy2004/test
 * branch            HEAD       -> FETCH_HEAD



版权声明:本文为yzlh2009原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。