github使用
来源:互联网 发布:淘宝上的翡翠能买吗 编辑:程序博客网 时间:2024/06/05 16:37
1.Mac下git现在使用比较简单了,git上有个可视化的工具,先下载,安装,一直下一步,填好自己的github帐号和密码。
2.打开终端,先测试一下你的帐号跟github连上没有:ssh -T git@github.com 如果出现如下提示,表示你连已经连上了.(因为有了第一步,所以不用自己做过多的连接github的操作了,另外,下一次要连接github的时候记得打开第一步的工具).
yingfengdeMacBook-Pro:-Tree yingfeng$ ssh -T git@github.com
Hi domzhaosh! You've successfully authenticated, but GitHub does not provide shell access.
3.在github建自己的Repository。建好后下面有一些代码提示你如何同步,当然先要cd到自己需要同步的目录,然后代码如下:
<span style="font-family: Arial, Helvetica, sans-serif;">touch README.md //新建一个记录提交操作的文档</span>
git init //初始化本地仓库git add README.md //添加 git commit -m "first commit"//提交到要地仓库,并写一些注释git remote add origin git@github.com:youname/Test.git //连接远程仓库并建了一个名叫:origin的别名,
git push -u origin master //将本地仓库的东西提交到地址是origin的地址,master分支下
</pre><pre name="code" class="cpp">
基本上就这么一个过程了,如果你的本地址仓库还有很多其它东西要提交,先要在本地仓库commit, 方法也是先git add 然后 git commit,这些都是commit到本地仓库,然后再push到选程.
下一次操作时,名叫origin的远程地址上次已经建好了,想看看可以用git remote -v 查看地址。
push的时候,先pull一下,本地同步下,再push
origin 忘了 可以通过下面查看
yingfengdeMacBook-Pro:-Tree yingfeng$ git remote -v
originhttps://github.com/domzhaosh/-Tree.git (fetch)
originhttps://github.com/domzhaosh/-Tree.git (push)
xingweiTreegit@github.com:domzhaosh/-Tree.git (fetch)
xingweiTreegit@github.com:domzhaosh/-Tree.git (push)
删除仓库
- 【GitHub】 github如何使用
- github之使用github
- Github使用
- GitHub使用
- github使用
- 使用github
- github 使用
- github使用
- Github使用
- GitHub使用
- GitHub使用
- github使用
- github使用
- github使用
- 使用github
- GitHub使用
- github 使用
- github使用
- 2014年10月3日于塞北
- 设计模式总结开篇
- 组合游戏(博弈)
- FFMPEG教程5_同步视频(使用2014年新SDK重新整理编译通过)
- 关于权限表的基本设计
- github使用
- 求质数算法的N种境界 (N > 10)
- 大数据实时计算工程师/Hadoop工程师/数据分析师职业路线图
- Maven之入门
- document.body、document.documentElement和window获取视窗大小的区别
- WebCollector爬虫的数据持久化
- FFMPEG教程6_同步音频(使用2014年新SDK重新整理编译通过)
- 写一个程序描述进程状态迁移过程
- android开发学习(二)——测试概念,junit测试框架, logcat