Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to remove a remote repository on Github through the command line?

Tags:

git

bash

github

I'm currently running a bash script to automatically create a remote repository on Github using curl. I was wondering if there was any way of also deleting remote Github repositories on the command line as well. Any help would be appreciated!

like image 674
Leeren Avatar asked Aug 19 '14 10:08

Leeren


People also ask

How to remove a git repository remotely?

Attention: The most common mistake while removing remote Git repository is typing the git remove remote command in your shell instead of using correct commands such as git remote rm and git remote remove. A rule of thumb to remember a correct command syntax: you’re asking git to manage remote repository, and you’re willing to remove it.

What is the difference between GIT remote RM and remote remove?

Note: the git remote remove command is just an alternative syntax (alias) for the git remote rm command. The git remote rm command allows you to delete a remote repository reference from the .git/config file located in your project folder.

How do I clone a repository on GitHub?

There are several ways to clone repositories available on GitHub.com. When you view a repository while signed in to your account, the URLs you can use to clone the project onto your computer are available below the repository details. For information on setting or changing your remote URL, see " Managing remote repositories ."

How do I push to a remote url on GitHub?

That URL could be your repository on GitHub, or another user's fork, or even on a completely different server. You can only push to two types of URL addresses: Git associates a remote URL with a name, and your default remote is usually called origin. You can use the git remote add command to match a remote URL with a name.


1 Answers

You could use the GitHub API "Delete repository" for that.
But you will need to use a oauth token with the appropriate scope (as mentioned here)
You can see an example in this question:

curl -X DELETE -H 'Authorization: token xxx' https://api.github.com/repos/USERNAME/REPO-NAME
like image 60
VonC Avatar answered Nov 14 '22 21:11

VonC