我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。

我打开终端使git按-f

remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found

我不确定会有什么问题。


当前回答

所以你的url当前看起来如下所示

https://github.com/RevanthM/Log_Monitoring

它应该是这样的

https://RevanthM@github.com/RevanthM/Log_Monitoring

不同的是,在url的开头,我添加了我的github用户名,后面跟着一个@符号。

其他回答

我也面临着同样的问题

remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found

我卸载了git凭证管理器并重新安装了它,然后我就可以很容易地将它拉到存储库中。下面是命令

$ git credential-manager uninstall

$ git credential-manager install

虽然前面的回复提供了各种解决方案,但我发现其中最简单的一个是将用户名添加到存储库的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,并在要求输入密码时输入令牌(而不是您的个人密码)。

如果你在windows上得到控制面板-> windows凭据,然后从通用凭据选项删除github凭据。然后尝试克隆

执行git远程更新对我来说很有效。

这里的问题是你的本地git无法将更改推送到远程 检查你的遥控器是否设置正确

git remote -v

如果没有正确设置,请尝试将您的遥控器设置为

git remote set-url origin https://username@github.com/MyRepo/project.git

然后尝试使用

git push -u origin master

也有可能你的本地git有不同的凭据,请检查一下。