第一步:去github上新建一个Repositories,填写Repository name和Description,点击create,获得一个地址。
第二步:在项目目录上,右键git bash here。
第三步:git clone 第一步的地址,在项目目录里会多出一个以Repository name命名的文件夹。
第四步:将项目里的所有文件都copy到新文件夹里。
第五步:cd到新文件夹目录,git add .(添加所有文件)。
第六步:配置信任的服务器HTTPS验证: git config --global http.sslVerify false。
第七步:git commit -m "xx"添加提交日志。
第八步:git push提交,会让输入github的账号和密码,输入成功后提交完成。
第五步若遇到问题:
warning: LF will be replaced by CRLF in app/src/main/res/drawable-anydpi/me_gray.xml.
The file will have its original line endings in your working directory
需要加一步:git config --global core.autocrlf false
具体原因见:https://blog.csdn.net/qq_35396905/article/details/94378795
网友评论