Github-repository是远程的,但在推送时找不到

时间:2013-07-07 07:41:10

标签: github

我正在尝试向github推送一些东西,我收到了这个错误;

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

然后,当我检查时,我得到了这个;

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)

任何人都知道我做错了什么?

2 个答案:

答案 0 :(得分:2)

使用正确的网址(用于克隆然后推送原点)是

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

不是:

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

Stanford-CS106b是一个回购,列在BitMechanic's repo page of d中。 Stanford-CS106b/Huffman不是。

要解决此问题,请参阅git remote commands

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

或更简单:

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

答案 1 :(得分:0)

可以粘贴

$cat .git/config

输出此处供参考。

有时最好从那里删除行为不当的遥控器,然后再次使用git remote add命令重新添加它。