intellij idea的GitHub安装与使用教程

git的安装教程:https://blog.csdn.net/weixin_42562514/article/details/85345724

1、安装成功后打开Git Bash,输入下列命令,设置git全局用户名和邮箱(具体为什么这样做本人也没搞懂)
intellij idea的GitHub安装与使用教程_第1张图片
代码需要自己敲,没法复制粘贴

2、创建本地仓库,VCS-->Import into Version Control-->Create Git Repository,选择当前项目文件夹,否则无法上传至GitHub,此时的文件颜色变成红色。
intellij idea的GitHub安装与使用教程_第2张图片
intellij idea的GitHub安装与使用教程_第3张图片

3、7.上传项目到本地仓库,项目右键选择Git-->add,此时项目文件变成绿色,此时文件只是处于暂存区,并没有真正进入到版本库中
intellij idea的GitHub安装与使用教程_第4张图片
intellij idea的GitHub安装与使用教程_第5张图片
4、项目右键Git--> Commit Directory,在弹窗中输入Commit Message,点击commit,此时项目文件从暂存区真正进入版本库中,项目文件变成白色
intellij idea的GitHub安装与使用教程_第6张图片
intellij idea的GitHub安装与使用教程_第7张图片
intellij idea的GitHub安装与使用教程_第8张图片

5、上传项目到GitHub中,VCS-->Import into Version Control-->Share Project on GitHub,在弹框中输入仓库名和描述,点击Share,即可是上传,中间会弹窗输入GitHub的用户名和密码(已输入过用户名和密码并记住的不会再次弹框输入),上传成功后IDEA右下角会给出提示
intellij idea的GitHub安装与使用教程_第9张图片
intellij idea的GitHub安装与使用教程_第10张图片

中间可能需要登陆GitHub账号,记得注意一下
intellij idea的GitHub安装与使用教程_第11张图片

6、提交修改文件到GitHub

  新增文件(红色),右键-->Git-->add,将新增的文件加入本地仓库,此时文件变绿色

  修改文件(蓝色)

  在项目右键-->Git-->Commit Directory,查看有变动的文件并输入Commit Message,点击Commit and Push...

  提交后会进行语法检查,若存在错误或警告会给出确认提示,点击Commit,弹出Push框,点击Push,上传GitHub成功
intellij idea的GitHub安装与使用教程_第12张图片
intellij idea的GitHub安装与使用教程_第13张图片
intellij idea的GitHub安装与使用教程_第14张图片
intellij idea的GitHub安装与使用教程_第15张图片

 

你可能感兴趣的:(java,软件安装教程)