这是我的资料库 https://github.com/kiotie32/artbit-text.git
$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/kiotie32/arbit-text.git/' not found
我在Windows 10计算机上。我已经配置了用于此笔记本电脑的ssh密钥。 我做了ls,我可以看到
MINGW64 ~/.ssh
$ ls
kiotie32_rsa kiotie32_rsa.pub known_hosts
我阅读了this thread上给出的所有答案 我更改了Windows凭据管理器中存储的密码。
我检查git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//'
我得到以下输出arbit-text
我更改了Windows凭据管理器中存储的密码,可能存储了旧密码。
我没有弹出询问用户名密码的弹出窗口。 (已配置ssh密钥,但不确定在Windows 10环境中是否可以使用ssh密钥,我将密钥存储在git bash中的.ssh中) 现在,我
$ git remote add origin https://github.com/kiotie32/arbit-text.git
fatal: remote origin already exists.
然后我做
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/kotie32/arbit-text.git'
所以我无法理解为什么会出现此错误/
我在这里https://stackoverflow.com/a/7572252/13012032尝试了解决方法做的第一个答案git commit -m "initial master"
然后我$ git push origin master remote: Repository not found. fatal: repository 'github.com/kotie32/arbit-text.git' not found
然后我尝试在评论中git add -all
然后我做了$ git push origin master remote: Repository not found. fatal: repository 'https://github.com/kotie32/arbit-text.git/' not found
然后从另一个答案https://stackoverflow.com/a/4183856/13012032中尝试了$ git show-ref
79d1730e9aa78f68a11ec4de6a0e8d6b66f17afb refs/heads/master
然后我做了$ git push origin HEAD:master
remote: Repository not found.
fatal: repository 'https://github.com/kotie32/arbit-text.git/' not found
我注意到在上面URL拼写kotie32的最后一个错误中,它应该是错误的
kiotie32
检查.git文件夹中的配置文件
然后我看到以下内容
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/kiotie32/arbit-text.git
fetch = +refs/heads/*:refs/remotes/origin/*
所以这里的url是正确的,拼写是kiotie32
,这是正确的。
好,我现在注意到已经形成了2个目录。
project folder/.git/.git
和<project folder>/.git
的配置文件网址错误
内层的<project folder>/.git/.git
具有正确的网址。
我更改了<project folder>/.git
的配置文件,并删除了子目录.git/.git
新的配置文件具有
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/kiotie32/arbit-text.git
fetch = +refs/heads/*:refs/remotes/origin/*
然后我再次做
$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/kiotie32/arbit-text.git/' not found
然后我做了
$ git remote set-url origin https://github.com/kiotie32/artbit-text.git
那么现在我可以推送到master分支了。