idea如何连接github项目

1、登录/注册github账号

2、安装git

3、打开git bash,输入ssh-keygen -t rsa -C "your_email@youremail.com"

后面的your_email@youremail.com改为在github上注册的邮箱,之后会要求确认路径和输入密码,默认的一路回车就行,成功的话会在~/下生成.ssh文件夹,进入文件夹,打开id_rsa.pub,复制里面的key。回到github上,进入 Account Settings(账户配置),左边选择SSH Keys,Add SSH Key,title随便写,把key粘贴到内容中。

4、为了验证是否成功,在git bash下输入:ssh -T git@github.com

如果是第一次的会提示是否continue,输入yes就会看到:You've successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上了github。

还需要设置username和email,因为github每次commit都会记录他们。

git config --global user.name "your name"

git config --global user.email "your_email@youremail.com"

至此idea就可以从github上克隆项目了,通过Check out from Version Control选择Git来克隆github项目。

 

posted @ 2021-12-17 03:37  李润  阅读(828)  评论(0编辑  收藏  举报