Github上私有仓库出现“Repository not found error”错误

3
我试图在源中推送分支时遇到了以下问题。 所以,我所做的是创建一个新分支并在其上添加提交。然后尝试推送。它显示:

fatal: The current branch Hotfix/Update_ducusign_semail_subject_line has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream origin Hotfix/Update_ducusign_semail_subject_line
然后,我运行了以下命令。
git push --set-upstream origin Hotfix/Update_ducusign_semail_subject_line

但是它会报以下错误,

远程:仓库未找到。

致命错误:未找到仓库 'https://github.com/nalam-nmef/NextGenTPR.git/'

enter image description here

这里有什么问题?

这是一个私有仓库。 - undefined
我删除了我的答案,因为使用私有仓库不需要SSH。 - undefined
是的,user.name和user.email已经正确配置。 - undefined
3
在运行 git push 命令时,user.nameuser.email 是无关紧要的,它们只在创建新提交时才有意义,而 git push 不会创建任何新提交。重要的是取决于你使用 ssh 还是 https。对于 ssh,确保ssh身份验证正常工作。对于https,请查看您配置 https 身份验证凭据的方式——这有很多方法,具体取决于操作系统——然后从那里继续进行。 - undefined
你对这个仓库有写入权限,不仅仅是读取权限,对吗? - undefined
显示剩余3条评论
3个回答

8

如果没有提供正确的凭据,Github不支持通过HTTPS连接到私有仓库。

现在您有两个选项:

  1. 切换到SSH并确保您的SSH密钥可在您的Github设置中使用:
    git@github.com:nalam-nmef/NextGenTPR.git
  2. 使用个人访问令牌提供HTTPS变体的凭据:
    https://nalam-nmef:[your-private-access-token-here]@github.com/nalam-nmef/NextGenTPR.git/

1

最好最简单的方法。谢谢 @Arnaud - undefined

0

我尝试了所有的方法,但都没有成功,所以我安装了GitHub桌面版https://desktop.github.com/

我会使用Git Bash添加和提交文件,然后使用GitHub桌面版进行推送。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接