下面跟我一起入手吧!
1、打开idea,点击vcs ----> checkout from version contril ----> Git
2、去git远程仓库复制git项目路径,注意:路径是http (https://github.com/wxxx/xxxx.git) ,还是ssh(git@github.com:wxxxx/xxxx.git)
)
3,将git远程项目路径复制到idea, 克隆到本地。
若报错:unable to access 'https://github.com/wxxxxx/xxxx.git/': error setting certificate verify locations:
或者 fatal: unable to access 'https://github.com/wxxxxx/xxxx.git/': error setting certificate verify locations:
CAfile: C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
CApath: none
解决方法:
用 git代替https,如 https://github.com/wxxxxx/xxxx.git
改为git://github.com/wxxxxx/xxxx.git
4.提示导入,点击取消。咱们先只是clone项目文件到本地,不import。
5.下载到本地后,File -->Open 选择刚下载的项目路径。我们在新窗口打开本地项目
6.打开后项目结构差不多是这样子的,项目名、子父模块完整,结构完美。但只是文件结构正常,很明显,Maven项目模块并没有被识别。
7、挨个添加识别项目下的Maven模块(容易出错地方)。
8.添加成功。
9,Maven项目算是导入成功,接下来就是配置IDEA的时候了。
Tomcat ---- Git ---- Maven ----- JDK ---- Ignore文件忽略等。