idea中git工具使用方法

1、 
首先在远程仓库上新建一个项目,码云和github都可以,我这里使用的是码云。

2、 
(1)进入码云,新建项目,如下图

idea中git工具使用方法_第1张图片

(2)点击创建,步骤如下

idea中git工具使用方法_第2张图片

(3)打开idea,新建一个maven项目,本项目只是为了测试

idea中git工具使用方法_第3张图片

(4)然后下一步

idea中git工具使用方法_第4张图片

(5)完成,点击上面的cvs,按照如下步骤

idea中git工具使用方法_第5张图片

(6)选择对应的项目,点击完成

idea中git工具使用方法_第6张图片

(7)然后右键点击项目,选择git–add进行添加到本地仓库

idea中git工具使用方法_第7张图片

(8)然后右键点击项目,选择git–commit进行提交到本地仓库

idea中git工具使用方法_第8张图片

(9)填写提交信息test,然后进行点击commit

idea中git工具使用方法_第9张图片

(10)然后push到远程仓库,

idea中git工具使用方法_第10张图片

(11)点击define remote

idea中git工具使用方法_第11张图片

(12)把之前远程仓库的地址输入进去

idea中git工具使用方法_第12张图片

(13)点击ok,然后点击下面的push即可。

最后,有两个注意的:

1、as报错 ******.is registered as a Git root, but no Git repositories were found there.

https://blog.csdn.net/huangcl_0416/article/details/79461526

2、git提交代码出现错误fatal: Unable to create '项目路径/.git/index.lock': File exists.

git提交代码出现错误fatal: Unable to create '项目路径/.git/index.lock': File exists.

解决方法:

在当前项目下打开git bash,运行如下命令:

rm -f ./.Git/index.lock

你可能感兴趣的:(杭研项目总结)