我刚刚从某个旧版本升级了 Git,现在每当我从远程存储库中提取时都会收到此警告消息:
$ git pull
warning: Config remote shorthand cannot begin with '/': /mnt/titanium/repos.url
warning: Config remote shorthand cannot begin with '/': /mnt/titanium/repos.fetch
这个远程存储库是 U 盘上的一个目录,我用它来将文件传输到没有直接网络连接的计算机。U 盘安装在 /mnt/titanium
$ git remote -v
warning: Config remote shorthand cannot begin with '/': /mnt/titanium/repos.url
warning: Config remote shorthand cannot begin with '/': /mnt/titanium/repos.fetch
origin /mnt/titanium/repos (fetch)
origin /mnt/titanium/repos (push)
我的 .git/config 看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[remote "/mnt/titanium/repos"]
url = origin
fetch = refs/heads/*:refs/remotes//mnt/titanium/repos/*
[remote "origin"]
url = /mnt/titanium/repos
fetch = refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
我阅读了有关此更改的原因,但我不明白我应该怎么做才能使此警告消失?