[git]使用Idea创建一个git项目
第一次使用git的方法,如建立的项目名叫:my-webapp
第一步:在远程gitlab上建立空白项目:my-webapp
第二步:在本地建立项目my-webapp,添加代码
第三步:创建一个本地仓库,VCS->Import into Version Control->Create Git Repository
![](https://img2018.cnblogs.com/blog/1541467/201812/1541467-20181227171530854-1404041037.png)
第四步:将项目commit到本地仓库:右键项目根目录->git->Commit Directory...
![](https://img2018.cnblogs.com/blog/1541467/201812/1541467-20181227171545764-595570175.png)
第五步:push项目到远程仓库:右键项目根目录->git->Repository->Push...
![](https://img2018.cnblogs.com/blog/1541467/201812/1541467-20181227171559205-578115005.png)