註冊github

step1 註冊github
註冊 github 賬號並創建一個repo,假設帳戶爲YourAccount,repo爲test_repo,[email protected]

step2 下載必要的軟件
下載git 軟件:

https://code.google.com/p/msysgit/
我用的是Git-1.8.3-preview20130601.exe

step3 安裝git並配置
下載後安裝,注意選擇

step4 生成公私鑰
打開git 命令行界面測試本地是否有ssh,在命令行輸入:

cd ~/.ssh

此時系統應該反饋“系統找不到指定文件”,那麼我們繼續輸入:

ssh-keygen -t rsa -C “your_email@your_email.com”

然後問你保存的目錄,請直接回車即可。 輸入一個密碼(passphrase)或直接回車,你註冊github時候的密碼,會生成如下內容:

在命令行輸入以下代碼將密鑰拷貝到剪貼板(或者用編輯器打開id_rsa.pub並複製其中的內容):

clip < ~/.ssh/id_rsa.pub

step5 拷貝公私鑰到帳戶
打開github Account Settings > SSH Keys > Add SSH key > ctrl+v按粘貼 >save

step6
請打開Git Bash,輸入如下代碼:

ssh -T [email protected]

如果提示“can’t be established.”什麼東西(如下代碼),請不要管,直接按yes

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)?
然後提示輸入密碼(passphrase) 如果看到

You’ve successfully authenticated, but GitHub does not provide shell access
信息,就表示連接成功。

step7 設置用戶名
$ git config –global user.name “YourAccount”

$ git config –global user.email “your_email@your_email.com”

stetp8 開始fork
cd /myfolder

git clone [email protected]/YourAccount/test_repo.git

在克隆過程中,會要求你輸入密碼(passphrase)。 git會自動把代碼下載下來,放在當前目錄下的myfolder目錄下

stetp9 獲取原始庫的最近更新
step10 將你的修改提交給 test_repo 原始庫
參考文章:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章