这是我的仓库 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
我阅读了此帖子上给出的所有答案。 我更改了存储在Windows凭据管理器中的密码。
我检查
git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//'
我得到以下输出arbit-text
我更改了存储在Windows凭据管理器中的密码,可能是存储了旧密码。我没有收到任何弹出窗口要求输入用户名和密码。(已配置ssh密钥,但不确定是否适用于我存储在git bash中的Windows 10环境。)
现在我这样做:
$ 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://dev59.com/vm855IYBdhLWcg3wuG0M#7572252,第一个答案是执行以下命令:
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://dev59.com/vm855IYBdhLWcg3wuG0M#4183856,执行以下命令:
$ 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
我注意到上面网址中最后一个错误中的拼写“kotie32”是错误的,它应该是
kiotie32
检查了.git文件夹中的config文件
然后我看到以下内容
[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
,这是正确的。
好的,我现在注意到已经形成了两个目录。
项目文件夹/.git/.git
和<项目文件夹>/.git
的配置文件有错误的URL,
而内部的那个,即<项目文件夹>/.git/.git
有正确的URL。
我更改了<项目文件夹>/.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
分支,测试main
:D - hamid Mahmoodi