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)
3. 在github中,通过上面的~/.ssh/id_rsa.pub 里面的公匙产生ssh key (ssh key是为了pull/push代码)
5. 在github产生token
input token name and select bo checkbox,click gerenate token, then you will get token, copy it
6. 打开IDEA 配git
7. 配GitHub, 选择 使用token,并粘贴上面产生的token
连上后,选中Clone repositories using ssh
6. clone 项目
7. 成功后, 如果你clone的repository里面包含多个project, 只需要将自己要开发的project从clone里面打开在IDEA中,此时会报 VCS root config错
点击上面的Configure, 会看到当前project的路径,点edit,去掉那个红色的当前project foler path,只保留root VCS那个就OK了