How can I delete a remote Git repository from the command line (Git Bash)?

后端 未结 3 1271
北海茫月
北海茫月 2021-02-14 05:47

I\'m trying to remove a remote git repository through Git Bash. I\'m aware that I can just delete it through GitHub; however, I want to learn how to do so throu

相关标签:
3条回答
  • 2021-02-14 06:03

    To delete a remote repo from cmd line, you can use following command

    git push origin --delete remote-reponame

    0 讨论(0)
  • 2021-02-14 06:11

    As pointed out by BrokenBinary in his comment,

    This can't be done.

    You cannot delete a remote repo (hosted on GitHub or elsewhere) with Git commands, be it in Git Bash or elsewhere, period. You can delete remote branches (assuming you have write access to them), yes, but not an entire remote repository.

    However, the GitHub Developer API allows you to delete, from your shell, a repo hosted on GitHub.

    0 讨论(0)
  • 2021-02-14 06:11

    As Jubobs mentioned above you can use github dev API, so: curl -u :username -X "DELETE" https://api.github.com/repos/:username/:repo Where :username = your username(github handler) and :repo = a name of a repo you want to get rid of

    0 讨论(0)
提交回复
热议问题