【发布时间】:2015-03-08 06:00:51
【问题描述】:
我正在尝试通过 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*
我意识到我也永远不会得到“起源”这个名字。
【问题讨论】:
-
2021年10月,现在有
gh repo delete:见my answer below。
标签: git github repository