2015-01-09 32 views
7

Sto provando a rimuovere un repository git remoto tramite Git Bash. Sono consapevole che posso semplicemente cancellarlo tramite GitHub; tuttavia, voglio imparare come farlo attraverso la linea di comando. Non voglio solo rimuovere i file al suo interno, o sostituirlo, voglio eliminarlo completamente. Ho trascorso gli ultimi due giorni spulciando tra forum, articoli, blog e tutorial, e niente ha funzionato.Come posso eliminare un repository Git remoto dalla riga di comando (Git Bash)?

Alcune informazioni iniziale:

$ 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) 

Alcune cose che ho provato:

$ 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* 

io mi sono reso conto anche non ottenere restituito il nome di 'origine'.

+1

Questo non può essere fatto. – BrokenBinary

risposta

5

Come sottolineato da BrokenBinary in his comment,

Questo non può essere fatto.

Non è possibile eliminare un repository remoto (ospitato su GitHub o altrove) con i comandi Git, sia esso in Git Bash o altrove, punto. Puoi delete remote branches (ammesso che tu abbia accesso in scrittura ad essi), sì, ma non un intero repository remoto.

Tuttavia, lo GitHub Developer API consente di eliminare, dalla shell, un repository ospitato su GitHub.

+1

Grazie a @BrokenBrinary e Jubobs. Credo che tornerò a cancellare i repository direttamente dal sito di GitHub. – dahiana

1

Come Jubobs di cui sopra è possibile utilizzare github dev API, quindi: curl -u :username -X "DELETE" https://api.github.com/repos/:username/:repo Dove : username = il vostro nome utente (gestore github) e : repo = a nome di un repo si vuole sbarazzarsi di

Problemi correlati