qns_fengyusong 发表于 2018-1-14 14:06:23

LLLLily

  参考文章:http://blog.csdn.net/dadaxiongdebaobao/article/details/52081826   git 将一个本地文件目录提交到远程仓库的步骤
  参考文章:http://www.cnblogs.com/eedc/p/6168430.html   如何用命令将本地项目上传到git
  1.(先进入项目文件夹)通过命令 git init 把这个目录变成git可以管理的仓库。
  

git init  

  2.把文件添加到版本库中,使用命令 git add .添加到暂存区里面去,不要忘记后面的小数点“.”,意为添加文件夹下的所有文件(夹)。
  

git add .  

  3.commit到主分支
  

git commit -m "描述"   

  4.登录github,把本地仓库提交至远程仓库。
  接下来你要做的就是复制那个地址,然后你将本地仓库个远程仓库连接起来。
  

git remote add origin git@github.com:yourname/仓库名.git  

  5.进行第一次提交
  

git push -u origin master  

  ps: windows系统中使用git时报错“warning: LF will be replaced by CRLF”解决方案:
  

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

  
//然后重新执行
  

  
$ git init
  
$ git add .
  

  

rm -rf .git慎用!!!!原因详见:https://www.zhihu.com/question/29438735 不小心敲了rm -rf后反应是怎样的?
页: [1]
查看完整版本: LLLLily