Git - 如何通过 URL 删除远程
Git - How to remove remote by URL
我已经尝试通过 URL 搜索如何删除远程,但所有建议都是删除整个远程并重新添加所需的 URLs。
最初,我添加了 url 使用命令,
git remote set-url --add --push all C:\Users\UserName\Desktop\TestPath
然后,在配置文件中所有可用的 url 中,我如何删除这个特定的 URL 行? (突出显示黄色)
我试过下面的命令git remote set-url --delete all C:\Users\UserName\Desktop\TestPath
但是我收到了这个错误 -> could not unset 'remote.all.url'
我还使用 git config --list --show-origin
检查了可用路径,只是为了再次确认该值仅来自这个特定文件。
如有任何想法,我们将不胜感激!
谢谢。
需要使用--push
参数,并且在url路径中也使用两个斜杠(这样会和配置文件中的写法一样)
git remote set-url --delete --push all C:\Users\UserName\Desktop\TestPath
--push
参数将指示操纵推送 URL 而不是获取 URL (git remote documentation)
我已经尝试通过 URL 搜索如何删除远程,但所有建议都是删除整个远程并重新添加所需的 URLs。
最初,我添加了 url 使用命令,
git remote set-url --add --push all C:\Users\UserName\Desktop\TestPath
然后,在配置文件中所有可用的 url 中,我如何删除这个特定的 URL 行? (突出显示黄色)
我试过下面的命令git remote set-url --delete all C:\Users\UserName\Desktop\TestPath
但是我收到了这个错误 -> could not unset 'remote.all.url'
我还使用 git config --list --show-origin
检查了可用路径,只是为了再次确认该值仅来自这个特定文件。
如有任何想法,我们将不胜感激!
谢谢。
需要使用--push
参数,并且在url路径中也使用两个斜杠(这样会和配置文件中的写法一样)
git remote set-url --delete --push all C:\Users\UserName\Desktop\TestPath
--push
参数将指示操纵推送 URL 而不是获取 URL (git remote documentation)