git - 如何从命令行 (Git Bash) 删除远程 Git 存储库?

标签 git github repository

我正在尝试通过 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”这个名字。

最佳答案

正如 BrokenBinary 在 his comment 中指出的那样,

This can't be done.

您不能使用 Git 命令删除远程仓库(托管在 GitHub 或其他地方),无论是在 Git Bash 还是其他地方。你可以delete remote branches (假设您对它们具有写入权限),是的,但不是整个远程存储库。

然而,GitHub Developer API允许您从 shell 中删除托管在 GitHub 上的存储库。

关于git - 如何从命令行 (Git Bash) 删除远程 Git 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27868636/

相关文章:

git - 预提交钩子(Hook)用于检查 git 中的版本

python - 当项目中任何位置的 python 文件(.py)发生更改时,如何运行 github 操作测试?

git - 重写路径时将本地 git 存储库迁移到更大的远程存储库

GIT:仅从 GitHub 克隆特定分支

eclipse - Atom 编辑器中的本地历史记录

Git 仍在尝试推送被忽略和删除的文件

git - 我做了一个 git Reset HARD 来修复错误的提交,但现在我的分支落后了

git - 我可以用 git 做一个目录列表,显示最新的提交日期吗

git - Yeoman 生成器 - 创建远程 github 存储库

git - 识别标签属于git中的哪个分支