简体   繁体   English

git:Github 上私有存储库的“未找到存储库错误”

[英]git: 'Repository not found error' for private repository on Github

I am facing the following problems while trying to push a branch in origin.尝试在原点推送分支时遇到以下问题。 So, what I have done is, created a new branch and add a commit on it.所以,我所做的是,创建了一个新分支并在其上添加了一个提交。 Then tried to push.然后试着推。 It shows,表明,

fatal: The current branch Hotfix/Update_ducusign_semail_subject_line has no upstream branch.致命:当前分支 Hotfix/Update_ducusign_semail_subject_line 没有上游分支。 To push the current branch and set the remote as upstream, use要推送当前分支并将远程设置为上游,请使用

git push --set-upstream origin Hotfix/Update_ducusign_semail_subject_line

Then, I run the following command然后,我运行以下命令

git push --set-upstream origin Hotfix/Update_ducusign_semail_subject_line

But it gives the following error,但它给出了以下错误,

remote: Repository not found.远程:未找到存储库。

fatal: repository ' https://github.com/nalam-nmef/NextGenTPR.git/ ' not found致命:未找到存储库' https://github.com/nalam-nmef/NextGenTPR.git/ '

在此处输入图像描述

What is the problem here?这里有什么问题?

Github does not support connections via HTTPS to private repositories, if you do not supply the correct credentials.如果您不提供正确的凭据,Github 不支持通过 HTTPS 连接到私有存储库。

You have two options now:你现在有两个选择:

  1. Switch to SSH and make sure your SSH key is available in your Github settings :切换到 SSH 并确保您的 SSH 密钥在您的Github 设置中可用:
    git@github.com:nalam-nmef/NextGenTPR.git
  2. Supply credentials for the HTTPS variant by using personal access tokens :使用个人访问令牌为 HTTPS 变体提供凭据:
    https://nalam-nmef:[your-private-access-token-here]@github.com/nalam-nmef/NextGenTPR.git/

You can easily authenticate with the github cli:您可以轻松地使用 github cli 进行身份验证:

https://cli.github.com/ https://cli.github.com/

I tried everything and it didn't work so I installed GitHub Desktop, https://desktop.github.com/我尝试了一切,但没有成功,所以我安装了 GitHub Desktop, https://desktop.github.com/

I would add and commit files with Git Bash and then push with GitHub Desktop.我将使用 Git Bash 添加和提交文件,然后使用 GitHub 桌面推送。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM