- 首先我们要键入到项目上的.git文件夹那里,才能去添加修改的代码
- git add . (add 和 . 之间是有空格的)
- git commit -m"里边是注释"
- git pull 为了避免冲突 先pull代码
- git push -u 提交就好了
windows中的换行符为 CRLF, 而在linux下的换行符为LF,所以在执行add . 时出现提示,解决办法:
- $ rm -rf .git // 删除.git
- $ git config --global core.autocrlf false //禁用自动转换
然后重新执行:
- $ git init
- $ git add .