第一步:创建一个git仓库
cd到你本地目录下,如果安装了git 就右键git bash here
1.git init 会出现一个.git文件夹说明ok了
第二步:将项目的文件添加到仓库
2.git add 文件名
第三步:将add的文件添加到仓库
3.git commit -m "注释语句"
第四部:去github上创建自己的Repository,创建页面如下
点击下面的Create repository 会进入一个页面,拿到创建仓库的https地址
第5步:将本地的仓库关联到github上
5.git remote add origin https地址
第6步:上传github之前,要先pull以下,
6.git pull origin master
第7步:上传到github
7.git push -u origin master
另外你想删除一些仓库中的文件可以在cd本目录下
git rm -r --cached “删除的文件名”
git commit -m "remove new gitignore directory"
git push origin master
ps:在这里origin指的是远程的仓库,master指的是分支。 push origin master 就是将本地的master分支推送到远程分支;
推荐git入门视频:http://edu.csdn.net/courses
或者不喜欢看视频的可以去廖雪峰git教程http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000