昨天我的 github 存储库开始出现奇怪的问题,当时突然提示输入用户和密码进行推送。 Git 是使用 ssh 设置的,几个月来没有进行任何更改。
$ git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
$ cat .git/config
/-/
[remote "origin"]
url = git@github.com:user/repo.git
/-/
$ git config remote.origin.url
git@github.com:user/repo.git
通过远程 set-url 重新设置也不会改变任何东西。 bitbucket repo 没有问题。我错过了一些变化吗?
最佳答案
我的 gitconfig 包含来 self 当前正在处理的项目之一的配置。引入了一个我不知道的新属性:
[url "https://github.com/"]
insteadOf = "git://github.com/"
结案。
关于linux - “git remote”显示的 url 与 .git/config 中设置的不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36446832/