步骤:
1.配置ssh key
配置用户名和邮箱
$ git config --global user.name "bob"
$ git config --global user.email "bob@google.com"
生成ssh公钥、私钥:
ssh-keygen -t rsa -C “bob@google.com”
按三次enter,设置密码为空
将公钥rsa_pub配置到github中
2.IDEA配置git.exe
Performance->Version Control->git->path to Git Executable->
将自己安装git的可执行文件路径填入Path to Git executable->点击 Test测试一下
3.克隆一个项目
VCS->git->clone->填入git链接
4.j检出一个分支
IDEA右下角:Branches->checkout As本地分支
5.检查变化
IDEA下方:Version control->Local changes->选中一个文件->右键->show diff
6.提交到本地
IDEA下方:Version control->Local changes->选中一个文件->右键->commit
7.推送到远程
VSC->git->push