我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定会有什么问题。
我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定会有什么问题。
当前回答
此消息可以在找到存储库时发生,但我们没有提交访问权。不是措辞巧妙的!
在克隆了老板为我创建的gitHub存储库后,我收到了repo-not-found消息。我可以在本地复制和提交,但不能向上推提交。存储库所有者没有给我写权限。通过请求对回购所有者的写访问来解决。
其他回答
我也有同样的问题
通过检查http。在git配置中的代理值(我的是不正确的和不需要的), 因此我删除了http。从git配置的代理值
命令:
列出文件中的配置项
git config --list
删除代理
git config --global --unset http.proxy
问题解决了!
虽然前面的回复提供了各种解决方案,但我发现其中最简单的一个是将用户名添加到存储库的URL中
git remote add origin https://your-username@github.com/your-username/repository-name.git
如果你已经定义了存储库(没有添加用户名),你可以按照以下方式更新它:
git remote set-url origin https://your-username@github.com/your-username/respository-name.git
当推送到远程存储库时,git不会从凭据助手中提取任何其他现有存储库的凭据,而是会询问用户/存储库在URL中定义的特定密码。
一般来说,我会不惜一切代价避免使用您的帐户密码,而是使用个人访问令牌。登录github,选择,
Settings > Developer Settings > Personal Access Tokens > Generate new token
只要确保在定义令牌范围时选中repo,并在要求输入密码时输入令牌(而不是您的个人密码)。
禁用GIT证书对我有帮助:
git config --global --unset credential.helper
试试这个,对我很管用。
git remote rm origin
git remote add origin https://github.com/your-username/{{project-name}}.git
我通过删除.git文件(隐藏文件夹),然后再次上传解决了这个问题。