git 远程 rm 不允许我删除配置部分?

git remote rm not allowing me to remove config section?

所以,这是我第一次制作网站,使用git,等等。

我试图使用 git 作为更新我的网站的一种方式。我被告知要执行以下操作:

git remote add live ssh://user@domain.com/absolute-path-to-site

其次是:

git push live master

当我尝试推送时收到以下消息:

fatal: '/absolute-path-to-site' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

我想我做错了什么并尝试使用

回溯
git remote rm ssh://user@domain.com/absolute-path-to-site

好吧,它不允许我删除路径,我得到:

error: Could not remove config section 'remote.ssh://user@domain.com/absolute-path-to-site'

我真的找不到任何可以帮助我解决这种情况的方法(或者我看起来不对)请帮忙。

您可以尝试在.git/config中手动删除遥控器,删除部分如下:

[remote "live"]
    url = ssh://username@fireplug.dreamhost.com/dev.website.com/wp-content/themes/astrid
    fetch = +refs/heads/*:refs/remotes/live/*

然后保存配置文件,并使用git remote -v仔细检查是否已删除。

正确的 git remote 命令是:

cd /path/to/my/local/repo
git remote remove live

不建议直接编辑 .git/config 文件。