将本地项目上传到git

第一步:建立git仓库 

cd到你的本地项目根目录下,执行git命令

git init

第二步:将项目的所有文件添加到仓库中

git add .

  注意:如果想添加某个特定的文件,只需把.换成特定的文件名即可

第三步:将add的文件commit到仓库

git commit -m "注释"

第四步:在github上创建自己的Repository,拿到创建的仓库的https地址

第五步:将本地的仓库关联到github上:

git remote add origin 地址

第六步:pull代码: 

git pull origin master

第七步,上传代码到github远程仓库

git push -u origin master

参考链接: http://blog.csdn.net/hanhailong726188/article/details/46738929

 

原文地址:https://www.cnblogs.com/beliveli/p/7245939.html