git执行pull命令时报错

今天在用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
Vultr 新用户注册就送100$
shunzi
  • 本文由 发表于 2019-03-2710:27:45
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
MySQL 5.7之主从复制搭建 MySQL

MySQL 5.7之主从复制搭建

MySQL5.7版本发版已经好久了,相对也比较稳定了,刚好今天搭好虚拟机环境,下面就来搭一套基于MySQL5.7版本的主从复制吧。 复制过程 master将变化的binary log events记录...
ChatGPT注册教程 BLOG

ChatGPT注册教程

最近ChatGPT真受欢迎,但是有些人注册时会经常面临不服务它们的地区问题,现在我们给你详细问题解决。 准备 代理。要求是韩国,日本,印度,新加坡,美国这些国家的地址都合适。对其他的我们还不太清楚,反...
deepin linux v20.2系统安装 BLOG

deepin linux v20.2系统安装

安装Deepin V20.2系统 最近因为学习需要,换了一台电脑,完了又是系统的安装。总之,docker环境折腾我了一个多星期。最后完美搞定。 ............ shunzi@thinkpad...
deepin linux V20系统安装 BLOG

deepin linux V20系统安装

安装系统 系统安装就不说了,网上一大把。以前用deepin linix 15.11系统非常舒服,后来因为办公环境需要,期间又换回windows,目前因为彻底能用linux办公了。一个字爽~ 系统跟新 ...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: