周五 迁移git环境 迁移之后同事反馈 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.
查了一下
找到:.git/config 修改如下
1 [branch "master"]
2 remote = origin
3 merge = refs/heads/master
于是在版本控制目录下打开 config文件 发现这行有了
然后确认了一下拉取代码的地址 发现config里的url 仍然是原来的url 修改成现在的就好了
也有可能是迁移后 key出问题了,解决不了的话重新生成key