参考链接:https://blog.csdn.net/fox9916/article/details/78253714
https://www.cnblogs.com/afeihome/p/6503550.html
【另外,笔者之前在cnblogs博客园上写过一篇博文,讲述了一种方式】http://www.cnblogs.com/m-yb/p/8810689.html
今天,笔者打算写另一种方式,大家可根据需求、喜好,选择:
先在本地项目的文件夹下,执行git init;
然后git add;
再git commit;
接着在web上创建项目,并复制项目的url地址;
【执行:git remote add origin https://gitee.com/xxx.git】
在你准备上传你的项目之前,最好更新一下项目,确保没有和远程仓库的代码有冲突
git pull --rebase origin master
再git push。
第一次推送在git push后面加上参数-u,使用-u选项指定一个默认主机。
1
|
$ git push -u origin master
|
git push -u origin master 本地仓库代码提交至远程仓库。
成功~,欢迎交流,【转载】请注明出处。https://blog.csdn.net/simplemanmyb/article/details/79980290
题外话:git学习资料-《Pro Git》有中文版,Git教程-廖雪峰。