码迷,mamicode.com
首页 > 系统相关 > 详细

Github for Mac - SSH keys

时间:2015-04-17 15:46:35      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:github for mac   ssh keys   github for mac客户端使用教   



准备:
(1)注册Github账号
(2)下载Github for Mac客户端并登录

这个时候可以从Github上Clone in Desktop ,把工程clone到电脑上,但是不能够把新建的工程上传到Github。还需要配置一些东西。

我们用Github的时候,常用的功能:下载,上传,修改,分支,多人合作开发,查看历史纪录,回到某一个时间节点开发。。。。

The most commonly used git commands are:

add           Add file contents to the index
bisect      Find by binary search the change that introduced a bug
branch      List, create, or delete branches
checkout       Checkout a branch or paths to the working tree     
clone               Clone a repository into a new directory
commit             Record changes to the repository
diff                  Show changes between commits, commit and working tree, etc
fetch               Download objects and refs from another repository
grep                     Print lines matching a pattern
init          Create an empty Git repository or reinitialize an existing one
log          Show commit logs
merge               Join two or more development histories together
mv                  Move or rename a file, a directory, or a symlink
pull                     Fetch from and integrate with another repository or a local branch
push              Update remote refs along with associated objects      
rebase               Forward-port local commits to the updated upstream head
reset             Reset current HEAD to the specified state
rm                    Remove files from the working tree and from the index
show                 Show various types of objects
status             Show the working tree status
tag                     Create, list, delete or verify a tag object signed with GPG

------------------------------------------
1. 检查SSH keys是否存在
命令行:ls -al ~/.ssh
chuuchuanwenchuangdeiMac:~ developer$ ls -al ~/.ssh
total 64
drwx------   8 developer  staff   272  4 16 15:59 .
drwxr-xr-x+ 25 developer  staff   850  4 15 11:47 ..
-rw-r--r--@  1 developer  staff  6148  4 16 15:59 .DS_Store
-rw-------   1 developer  staff  1766  3 20 18:29 github_rsa
-rw-r--r--   1 developer  staff   404  3 20 18:29 github_rsa.pub
-rw-------   1 developer  staff  1675  4 16 15:55 id_rsa
-rw-r--r--@  1 developer  staff   422  4 16 16:18 id_rsa.pub
-rw-r--r--   1 developer  staff  1199  4 15 11:47 known_hosts

如果有文件id_rsa.pubid_dsa.pub,表示ssh key存在。

命令行: ssh-keygen -t rsa -C “你的邮箱(abc@.xx.com)”

chuuchuanwenchuangdeiMac:~ developer$ ssh-keygen -t rsa -C "abc@.xx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/developer/.ssh/id_rsa): /Users/developer/.ssh/id_rsa.pub
/Users/developer/.ssh/id_rsa.pub already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/developer/.ssh/id_rsa.pub.
Your public key has been saved in /Users/developer/.ssh/id_rsa.pub.pub.
The key fingerprint is:


通过这个命令行ssh-keygen -t rsa -C “你的邮箱(abc@.xx.com)”连接Github,生成public/private rsa key pair,提示你是否覆盖,选择y覆盖,然后提示你输入密码,最后提示你保存成功。
你可以通过/Users/developer/.ssh/id_rsa.pub.pub前往你的文件夹查看。
技术分享

然后你需要下载一个可以打开pub的软件。我下载的是这个Sublime Text软件。用这个软件打开它,复制里面的内容(.pub 里的格式为:"ssh-rsa 空格 key值 空格 你的邮箱")

(1)登陆到你的Github,找到设置按钮
技术分享

(2)SSH Keys  ->   Add SSH key
技术分享

---------
技术分享
直到没有报错,显示绿色的。
-------------------------------------------


现在可以使用Github for Mac客户端上传工程文件了。
技术分享

--
技术分享

--
技术分享

--
技术分享

--
这样子就提交上去了。可以在Github上自己的主页Repositories查看
技术分享

--












Github for Mac - SSH keys

标签:github for mac   ssh keys   github for mac客户端使用教   

原文地址:http://blog.csdn.net/u010241322/article/details/45096391

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!