零错误(警告)操作:
git config --global core.autocrlf false
git init
git pull origin master --allow-unrelated-histories
git push -u origin master
之前创建 git 仓库时总是出现以下各种级别的一连串错误
Warning
warning: LF will be replaced by CRLF in .gitignore
- 删除已有git
rm -rf .git
- 禁用自动转换
git config --global core.autocrlf false
- 再次创建即可
git init
Error
error: failed to push some refs to “git@……”
- 出现于项目初始化时,先pull:
git pull origin master
- 解决冲突后push
git push -u origin master
Fatal
fatal: refusing to merge unrelated histories
git pull origin master --allow-unrelated-histories
- 解决冲突后push