学git一段时间,可惜公司用的是svn,平时少用,又忘了,总结一下,免得下次又得重新学习。得多多用才是正道!
一. 将本地的提交到网上git仓库
1.在git创建仓库
![](https://images0.cnblogs.com/blog/578137/201501/071441544689704.png)
2.在本地文件中,输入git init初始化,让git接管
![](https://images0.cnblogs.com/blog/578137/201501/071443488756019.png)
![](https://images0.cnblogs.com/blog/578137/201501/071443257658479.png)
3.用git add *, git commit -m "写些信息", 两个命令提交到本地仓库
![](https://images0.cnblogs.com/blog/578137/201501/071443583434627.png)
4.从刚才创建的git仓库中copy到git命令窗口,将本地仓库同步到远程仓库
git remote add origin git@github.com:ivan403704409/learngit.git
git push -u origin master
![](https://images0.cnblogs.com/blog/578137/201501/071444070783391.png)
![](https://images0.cnblogs.com/blog/578137/201501/071445046872692.png)
创建成功,刷新页面就可以看到咯!!!
![](https://images0.cnblogs.com/blog/578137/201501/071445174539524.png)
5.在下一次修改时,只需
git add '修改了的文件名',
git commit -m "写些信息",
git push origin master;
就可以更新到远程仓库