1,尽量使用项目的HTTPS的链接

github上传项目问题详解

2,fatal: refusing to merge unrelated histories

使用这个强制的方法

git pull origin master --allow-unrelated-histories

3,fatal: remote validator already exists.

(1)可以知道其实本地已经同步过一次的github版本库了。需要把原先的删除
(2)先删除远程 Git 仓库 $ git remote rm origin
(3)再添加远程 Git 仓库,成功

4,git add .引起的问题

问题是该命令会造成上传的文件会覆盖仓库里之前的代码,不过没关系,git机制就是解决这个问题的。
=》解决办法:回滚。
(0),查询版本号
登录github网站,查看仓库提交记录,点击
github上传项目问题详解
github上传项目问题详解
复制版本号,下面要用。
(1)回滚到指定的版本

git reset --hard e377f60e28c8b84158

(2)强制提交

git push -f origin master

5 ,Git fatal: The remote end hung up unexpectedly

github上传项目问题详解

相关文章:

  • 2021-05-25
  • 2021-05-09
  • 2021-04-05
  • 2021-04-24
  • 2021-09-15
  • 2022-12-23
  • 2022-02-09
  • 2021-05-15
猜你喜欢
  • 2021-06-08
  • 2021-04-18
  • 2021-12-13
  • 2021-09-20
  • 2021-08-22
  • 2021-06-27
相关资源
相似解决方案