我正在尝试通过 Git Bash 删除一个远程 git 仓库。我知道我可以直接通过 GitHub 删除它;但是,我想学习如何通过命令行删除它。我不只是想删除其中的文件或替换它,我想彻底删除它。我花了过去两天的时间在论坛、文章、博客和教程中查找,但没有任何有效的解决方法。
一些初始信息:
$ git remote -v
thisbranch https://github.com/thisuser/test-repo.git (fetch)
thisbranch https://github.com/thisuser/test-repo.git (push)
$ git status
On branch master
nothing to commit, working directory clean
$ git log
Author: *info*
Date: *info*
adding a new file
Author: *info*
Date: *info*
Initial commit
$ git remote -v show thisbranch
* remote thisbranch
Fetch URL: https://github.com/thisuser/test-repo.git
Push URL: https://github.com/thisuser/test-repo.git
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
我尝试过的一些事情:
$ git remote remove https://github.com/thisuser/test-repo.git
error: Could not remove config section 'remote.https://github.com/thisuser/test-repo.git'
$ git remote remove master
error: Could not remove config section 'remote.master'
$ git remote remove thisbranch
*returns nothing*
$ git remote -v
*returns nothing*
我意识到我也从未收到名称为“origin”的返回值。
gh repo delete
:请参见我的下面的答案。 - VonC