1.warning: LF will be replaced by CRLF
在linux下的换行符为LF,所以在执行add . 时出现提示LF换行符会被强制替换CRLF
解决:
$ rm -rf .git // 删除.git
$ git config --global core.autocrlf false //禁用自动转换
然后重新执行:
$ git init
$ git add .
2.git push时提示ssh: connect to host github.com port 22: Connection refused
或者Permanently added 'github.com,13.229.188.59' (RSA) to the list of known hosts. Permission denied (publickey).
原因:管理员创建版本库时选的是指定用户可以推送,但是你这个用户没有推送:
解决:给这个用户授权。gitlab的操作如下,点开版本库--编辑--permissions--左侧用户添加到右侧,右侧是拥有推送权限的用户---ok。重新push即可