我有一个非常奇怪的问题与git和github。当我试着推的时候,我得到:

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

我添加了遥控器:

git remote add origin git@github.com:account-name/repo-name.git

什么好主意吗?


当前回答

检查是否具有读写权限。

Git错误消息具有误导性。我也遇到过类似的问题。我被添加到一个现有的项目中。我克隆了它并提交了一个本地更改。我去推,得到了ERROR: Repository not found。错误消息。

将我添加到项目的人给了我对存储库的只读访问权。他们做出了改变,我得以推动。

其他回答

在执行此操作之前,请确保您拥有对回购的写权限。如果您仍然得到错误,请执行以下操作:

Generate a personal access token from your account from Settings > Developer Settings > Personal Access tokens. Keep the token safe somewhere. Go to your repository and run the following: git remote rm origin Then add a new origin along with your username: git remote add origin https://USERNAME@github.com/REPOSITORY_LINK.git Now when you push the code, a prompt will show up asking for your password or personal access token. Paste the token that we generated in the first step in the field, and we're done.

如果使用私有存储库检查连接用户,则该用户必须具有使用存储库的权限。

我需要杀死凭证帮助进程(有多个),它在再次提供凭证后解决了这个问题。

killall git-credential-cache——守护进程

问题:由于某些原因,Github不熟悉你的存储库。

Error:在git cli中提示如下:

remote:未找到存储库。致命:库 “https://github.com/MyOrganization/projectName.git/”未找到

解决方案:2个选项

Github might not familiar with your credentials: - The first Option is to clone the project with the right credentials user:password in case you forgot this Or generate ssh token and adjust this key in your Github. aka git push https://<userName>:<password>@github.com/Company/repositoryName.git Repo Permissions Issue with some users - In my Use case, I solved this issue when I realized I don't have the right collaborator permissions on Github in my private repo. Users could clone the project but not perform any actions on origin. In order to solve this:

去Github上的仓库->设置->合作者和团队->添加 成员/维护你的用户->现在他们获得了提交的权限 ,推动

首先在命令行上创建一个新的存储库,命名为adim .git

在命令行上创建一个新的存储库

触摸README.md git init git添加README.md Git commit -m "第一次提交" git远程添加origin https://github.com/your_name/Ademo.git Git push -u origin master

从命令行推送现有存储库

git远程添加origin https://github.com/your_name/Ademo.git Git push -u origin master