Centos 6.6系統下安裝Github
首先安裝github
# yum install git
完成之後
https://help.github.com/articles/generating-ssh-keys/#platform-linux 官方設定教程在這個網址下
我來說明一下我的配置
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
運行這段代碼 your_email@example.com 就是你自己的github郵箱。。。不要問我github怎麼註冊。。。百度一下。
提示:
Generating public/private rsa key pair.
出現:
Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
按斷行符號
Enter passphrase (empty for no passphrase): [Type a passphrase]# Enter same passphrase again: [Type passphrase again]
輸入兩次密碼,用來後面擷取sshkey
提示:
Your identification has been saved in /Users/you/.ssh/id_rsa.# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.# The key fingerprint is:# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
運行:
eval "$(ssh-agent -s)"# Agent pid 59566
綠色是成功的提示
再運行
ssh-add ~/.ssh/id_rsa
到了下一步就跟官方說的不一樣,因為辣個xclip小哥我沒裝(也沒裝好,缺個X11什麼的。。。以後裝好了再跟大家說)
運行:
cat ~/.ssh/id_rsa.pub
會拿到一段ssh-rsa 開頭your_email@example.com 結尾的key
然後拿到這段key
登陸github的網站去添加,這段教程在官網中有,在setting 的SSH keys裡Add ,會發帖的都會。
添加成功以後
運行:
ssh -T git@github.com
檢測是否連結上
看到下面兩個代碼出現,你就超神一般的搞定了
The authenticity of host 'github.com (207.97.227.239)' can't be established.# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.# Are you sure you want to continue connecting (yes/no)?
# Hi username! You've successfully authenticated, but GitHub does not# provide shell access.
關於怎麼把項目拉下來
cd 到你要拉的目錄下,拉的。。。好吧換個詞,存放的目錄下
運行
git clone https://github.com/JustLittleBoy/One.git
如果在你的目錄下出現了一個One檔案夾裡面還有一個index.php的檔案就ok了