使用git 提交代码

  1. 首先我们要键入到项目上的.git文件夹那里,才能去添加修改的代码
  2. git add .      (add   和  .  之间是有空格的)
  3. git commit -m"里边是注释"
  4. git pull      为了避免冲突  先pull代码
  5. git push -u 提交就好了

windows中的换行符为 CRLF, 而在linux下的换行符为LF,所以在执行add . 时出现提示,解决办法:

  • $ rm -rf .git  // 删除.git 
  • $ git config --global core.autocrlf false  //禁用自动转换  

然后重新执行:

  1. $ git init   
  2. $ git add . 

猜你喜欢

转载自blog.csdn.net/dream_caoyun/article/details/80322429