2013-07-07 3 views
1

J'essaye de pousser quelque chose à github et j'obtiens cette erreur;Github-repository est sur distant mais pas trouvé en poussant

Robbies-MacBook-Pro:assn-6-huffman-mac user$ git push -u origin master 
fatal: repository 'https://github.com/BitMechanic/Stanford-CS106b/Huffman.git/' not found 

Puis, quand je vérifie, j'obtiens ceci;

Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote add origin https://github.com/BitMechanic/Stanford-CS106b/Huffman 

fatal: remote origin already exists. 

Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote -v 

origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git 
(fetch) 

origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git 
(push) 

Quelqu'un sait ce que je fais mal?

+0

Pourquoi utilisez-vous https? Généralement github fonctionne sur SSH, et vous serez probablement beaucoup plus heureux quand vous aurez cette configuration. Êtes-vous par hasard venant de mercurial? – tjameson

+0

Vous voulez que l'URL d'origine lise '[email protected]: BitMechanic/Stanford-CS106b/Huffman.git', i. e. l'URL SSH au lieu de l'URL HTTP. –

+0

J'utilise ssh, je vais l'essayer sans le https ... –

Répondre

0

Pouvez-vous coller l'

$cat .git/config 

sortie ici pour référence.

Il est parfois préférable d'enlever les télécommandes qui se comportent mal à partir de là et de les rajouter en utilisant à nouveau la commande git remote add.

+0

[coeur] \t repositoryformatversion = 0 \t FileMode = true \t nu = false \t logallrefupdates = true \t = true ignorecase \t precomposeunicode = false [ "origine" à distance] \t url = https://github.com/BitMechanic/Stanford-CS106b/Huffman.git \t fetch = + refs/heads/* : refs/remotes/origin/* –

+0

avez-vous essayé de supprimer l'origine [remote " ] et l'ajouter à nouveau en utilisant la commande git remote add? Je pense que cela devrait fonctionner. – Shreyas

+0

Je l'ai fait un certain nombre de fois avec git @ ou https: // mais aucun ne fonctionne –

2

Le bon URL à utiliser (pour le clonage puis poussant à travers l'origine) est

https://github.com/BitMechanic/Stanford-CS106b.git 

pas:

https://github.com/BitMechanic/Stanford-CS106b/Huffman.git 

Stanford-CS106b est une prise en pension, figurant dans le BitMechanic's repo page of d. Stanford-CS106b/Huffman ne l'est pas.

Pour résoudre ce problème, voir git remote commands:

git remote rm origin 
git remote add origin https://github.com/BitMechanic/Stanford-CS106b.git 

ou, plus simple:

git remote set-url origin https://github.com/BitMechanic/Stanford-CS106b.git 
+0

@NilsWerner merci pour l'édition. En fait 'git remote set-url' est plus simple dans ce cas;) – VonC

+0

Super, merci beaucoup! –

Questions connexes