git rm -r --cached .
git add .
git commit -m 'update .gitignore'
  • git fatal: 拒绝合并无关的历史的错误解决
本地初始化的项目 与 github 版本不一致, 导致无法提交

$ git pull origin master
 * branch            master     -> FETCH_HEAD
fatal: 拒绝合并无关的历史
解决方法

在pull 时候, 添加–allow-unrelated-histories参数 即可.

$ git pull origin master --allow-unrelated-histories                   
来自 https://github.com/itaken/python-login-demo
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 LICENSE | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 LICENSE

git config --global core.autocrlf false

分类: git

0 条评论

发表回复

您的电子邮箱地址不会被公开。