iOS小白,不知其所以然。只能参考别人的。网上找了很多,但是都不是很明白,后来找到一偏教程终于学会了。来跟大伙说说,也是复习了。
想直接看大神的教程的话直接附上大神的教程,http://www.cnblogs.com/heyonggang/p/3462191.html,
1.先下载一个Github客户端(我用的是mac 客户端,注册github帐号,这两个比较简单
2.创建ssh:
1)打开终端,检查有没有ssh:$cd ~/.ssh
有的话创建到其它目录里。要记得目录,没有的话自己创建
$ssh-keygen -t rsa -C xxxxx@gmail.com(注册github时的email)
成功的提示
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/twer/.ssh/id_rsa):
Created directory '/Users/twer/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/twer/.ssh/id_rsa.
Your public key has been saved in /Users/twer/.ssh/id_rsa.pub.
The key fingerprint is:
18:16:11:c9:01:6c:48:09:7f:27:c6:43:0d:7f:3f:84 xxxxx@gmail.com
The key's randomart image is:
+--[ RSA 2048]----+
|.o.++=== |
|.ooo.+. . |
| ..* = E . |
| o = + o |
| . S o |
| . |
| |
| |
| |
+-----------------+
3.在github中添加ssh
4.打开终端,先测试一下你的帐号跟github连上没有:ssh -T git@github.com 如果出现如下提示,表示你连已经连上了.(因为有了第一步,所以不用自己做过多的连接github的操作了,另外,下一次要连接github的时候记得打开第一步的工具).
当提示下面这个就成功了。
Hi MiracleHe! You've successfully authenticated, but GitHub does not provide shell access.
不过我开始是提示了其它的,当时忘了截图,是提示我是否重新连接,选择yes,然后一步一步往下点,也提示成功了。
5.在github下建自己的Repository。大神是直接在网页上传的,因为我下了客户端就直接在客户端上传了。
打开客户端,然后用github帐号登录,我之前一直登陆不上,原因是因为我的ssh没有保存到官网上吧,完了之后后来就能登录上了。
然后就能上传成功啦。注意,工程名用中文的话显示不出,会显示“-”