顺子の杂货铺
生命不息,折腾不止,且行且珍惜~

git执行pull命令时报错

DMIT VPS

今天在用git拉取代码的时候报错,内容如下:

You asked to pull from the remote 'origin', 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.

Google了一下发现,默认配置问题:

因为我的git remote配置了两个代码地址,一个别人的,一个自己的,而且.git/config配置里默认的是自己的地址,而我要pull的却是别人的代码。所以报错。

解决方法:

git config -e

修改remote=origin(把branch "master"的默认remote改成你要fetch的地址即可)

[branch "master"]
        remote = origin
        merge = refs/heads/master
赞(0)
未经允许不得转载:順子の杂货铺 » git执行pull命令时报错
搬瓦工VPS

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

分享创造快乐

联系我们联系我们