我有一个非常奇怪的问题与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和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
什么好主意吗?
当前回答
如果你使用https从github克隆,但你使用ssh推送,你也会得到这个错误。
要纠正这个问题,打开.git/config并替换:
Url = https://github.com/company/project.git
With
Url = git@github.com:company/project.git
你应该可以在没有任何警告的情况下推…
其他回答
首先在命令行上创建一个新的存储库,命名为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
我也遇到过同样的问题,是私人回购。
做以下几点:
移除远端原点
git remote rm origin
重新添加原点,但与您的用户名和PWD与写权限在这个PVT回购
git remote add origin https://USERNAME:PASSWORD@github.com/username/reponame.git
如果你属于一个组在Github检查你有写访问权。
如上Alex所说,更改.git/config文件的内容会有所帮助。我也遇到了同样的问题,我想这是因为我更改了我的Github用户名。无法使用更改更新本地文件。所以当你改变你的用户名时,你可能会考虑跑步
Git远程添加原点your_ssh_link_from_github
我希望这对你有所帮助;)
有类似的问题。问题的根源是我遵循了一些关于向Github添加新存储库的在线教程。
只要去Github,创建一个新的repo,它会要求你添加一个README,不要添加它。创建它,你会得到如何推送的指导。
它类似于接下来的两行:
git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master