错误:无法将一些引用推送到'https://github.com/

这是我的资料库 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分支了。

wuhengqu520 回答:错误:无法将一些引用推送到'https://github.com/

只需尝试以下命令:-

MainActivity.MainActivityContext.finish();

希望,它会有所帮助!谢谢!

,

这对我有帮助。

git push origin master:main

哪个 master 是我的本地分支,main 是我的远程分支。我认为这是因为 Github 将 master 重命名为 main

,

它对我的情况有效

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

添加你的邮箱和github名称

,

通常在尝试“git push”命令时我会收到此错误消息。 运行以下命令

git add --all

然后

git push -u origin main

它应该可以解决您的问题。希望能帮到你!

,

实际上是由于更改了 Github 帐户的凭据而发生的

例如您的 gitbash 过去从您拉或推同步到 'A' 帐户存储库,但此时您要推送或拉取 'B' 帐户存储库强>。这意味着您尝试推送或拉取属于其他帐户而非旧帐户的存储库。 这时候这个异常(错误'未能将一些引用推送到'https://github.com/')会上升。

实际上操作系统(Linux 或 Windows)将您的帐户身份验证存储在旧帐户的凭据管理器中。当您从帐户“B”回购(新帐户)推送或拉取时。

Gitbash 使用存储在操作系统凭据管理器中的帐户“A”(旧帐户)的凭据验证您的帐户“B”(新帐户)。比上升这个错误。

解决方案

  1. 在 Windows 搜索栏中输入“凭据管理器”

How to Open Credential manager

2.打开凭证管理器 3. 单击 Windows 凭据

How to Open windows Credential Manager

  1. “点击 git:https://GitHub.com”

How to Remove Github Credential

  1. 删除凭据之后。您将推送它会询问新帐户详细信息因为它验证您的代码将被推送或拉取。

  2. 如果你不能拉或推超过你设定的

你是电子邮件和你的名字,而不是推送

git config  user.email 'xxxx@gmail.com'
git config user.name 'xxxxx'

再推

git push -u origin branch_name

感谢您的提问

,

我遇到了类似的情况,但就我而言,我有一个本地存储库,必须与远程存储库连接。

我是这样解决的,

  • 通过github在线创建repo并复制其地址(使用与本地文件夹相同的名称)
  • CD 到本地 git repo 并添加远程 git remote add origin [add remote repo address]
  • 检查本地工作分支是否有可能在主分支或主分支上工作
  • 提交并推送到相关分支 git push origin master
,

您看到该错误是因为您的本地 git 存储库仍然是空的。进行一些提交,一切都会完美运行。

,

检查,也许您尝试不提交就进行推送。尝试提交更改。

git commit -m "my commit"

或键入git branch来查看是否已设置远程URL。如果未显示任何内容,请添加远程原始URL git remote add origin https://github.com/username/projectname.git。 然后尝试git push origin master

,

仅适用于其他任何人,如果您遇到此错误,可能

  • 您不在计算机上存储库的主目录中。

-您尚未添加或提交更改

只是一个提示。

,

我遇到了同样的问题,但是这个命令解决了它。

尝试:

[Route("GetUsersForNPO")]
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetUsersForNPO(int npoId) 
,

我遇到了同样的问题,我执行了以下命令

git add --all

这个 cmd 添加所有文件,然后提交完成

git commit -m [message]

然后我终于能够通过表演来推动

git push -u origin main

希望对你也有用

,

我遇到了同样的错误。 然后,我意识到原始分支不再称为原始分支。然后,我尝试了这段代码,它起作用了:

git push origin main

只需将master替换为main。

,

还有一件事情(以防万一将来可能对某人有所帮助): 您必须要推动。

,

这对我有用!

git push --set-upstream origin main
,

在以下情况下也可能发生此错误

  1. 如果您更改了github用户名,密码或电子邮件
  2. 如果在使用github凭据配置Windows的情况下尝试将提交推送到其他人的分支

在上述情况下我遇到了此错误,这就是我的解决方法

  1. 已删除存储在Windows凭据管理器中的github凭据

  2. 此后,我尝试使用以下命令再次推送提交,然后提示我输入github凭据。 (如果您要推送到其他人的存储库,请确保输入该github用户帐户的凭据

    git push -u(回购网址)(分支名称)

,

尝试做 git pull origin repo-name

然后尝试 git push origin repo-name

,

尝试使用此命令:

git push

确认用户名和密码 完成。

,

如果您不在主分支,请检查您当前的分支,然后尝试此命令:

git branch master

这会将我们当前的分支更改为 master 分支。最后做

git push -u origin master
本文链接:https://www.f2er.com/2655681.html

大家都在问