github自建 repository 過程

  • github 網站新建 repository ( 略 )
  • github 設置電腦的 ssh key

    通過 ssh-keygen 命令創建新的 key

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/akiller/.ssh/id_rsa):

這裏輸入 lenzener(你要用的key名稱), 後面的直接回車
然後會在 ~/.ssh/下生成 id_ras_lenzener.pub

  • 列表內容

    設置電腦端本地的 config
    通過編輯 ~/.ssh/config 文件, 在文件的末尾加入

Host github-lz
        HostName github.com
        User git
        IdentityFile ~/.ssh/id_rsa_lenzener

  • 通過 ssh 把 github 新建的 repository clone 下來

git clone git@github-lz:lenzener/tf.git

  • 下面就是正常的git操作了.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章