如何在IEDA中连github

1. 装git

2. 打开gitBash, 产生ssh pub key

  • ssh-keygen -t rsa -b 4096 -C "[email protected]"
  • eval $(ssh-agent -s)
  • ssh-add ~/.ssh/id_rsa      (add ssh key to ~/.ssh/id_rsa)
  • clip <~/.ssh/id_rsa.pub    (copy the key to clipboard,  if clip has issue, open $HOME/.ssh/id_rsa.pub in an text editor, and ctrl+C to copy to clipboard)
  • 484f409f243759c77253ce81522794ef152.jpg

3. 在github中,通过上面的~/.ssh/id_rsa.pub 里面的公匙产生ssh key (ssh key是为了pull/push代码)

3b23f96dc194fae824d28d47296f6bc0d05.jpg

 

5. 在github产生token

b89f62a48d425ab075ea9d175212eca9e6a.jpg

 

input token name and select bo checkbox,click gerenate token, then you will get token, copy it

366951143b8fb06f72a740e8e5a24618ec4.jpg

 

6. 打开IDEA 配git

8754c111202f2a025c436da2cec68f8ad0d.jpg

7. 配GitHub, 选择 使用token,并粘贴上面产生的token

2a9f5357c9c1c127c63d5e563b14c2c5291.jpg

连上后,选中Clone repositories using ssh

6c70a7069f0681ddcb2533122af38f3c23c.jpg

6. clone 项目

6d099dcd1a9d9dd24b26f55a64d97f407e3.jpg

6573f872861f5578404fd25f8b34cc05890.jpg

 

7. 成功后, 如果你clone的repository里面包含多个project, 只需要将自己要开发的project从clone里面打开在IDEA中,此时会报 VCS root config错

f16b02a01d17b29551c0d095c26cb756f2f.jpg

点击上面的Configure, 会看到当前project的路径,点edit,去掉那个红色的当前project foler path,只保留root VCS那个就OK了

ab5d1c16393ed11839234c6fde02ab63954.jpg

 

 

转载于:https://my.oschina.net/hcp/blog/3035666