1. 程式人生 > >Mac下 Gitlab和Sourcetree使用 2018

Mac下 Gitlab和Sourcetree使用 2018

0. 先去Sourcetree官網下載最新的軟體,然後翻牆註冊下(註冊很簡單的)

1. 在控制檯輸入命令 ssh-keygen -t rsa -C "你的email地址"  生成rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/sunww/.ssh/id_rsa): id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
SHA256:Hfmn1iZ1m+sew4fa+70kEitokYzmMsvzx4hZ
The key's randomart image is:
+---[RSA 2048]----+

+----[SHA256]-----+


2.將上面生成的id_rsa.pub檔案的祕匙內容(control + A)全部拷貝到我的gitlab設定下面的 SSH Keys中然後ok,隨便輸入一個title,然後ok

3.給本地的sourcetree新增祕匙
命令 ssh-add /Users/sunww/id_rsa

TF012778:~ sunww$ ssh-add /Users/sunww/id_rsa
Enter passphrase for /Users/sunww/id_rsa:
Identity added: /Users/sunww/id_rsa (/Users/sunww/id_rsa)

4. 然後開啟sourcetree,新建url

通過以上幾步的配置處理,你就可以enjoy your code !