1.创建git仓库:vcs->import int version control->Create git repository
2.在项目头点击右键->git->add
3.在项目头点击右键->git->commit director
4.进入commit director界面,点击commit and push
5.push出现问题:Push to xxx/master was rejected
6.解决问题:Git-2.13.0-32-bit.exe(先安装),在项目的目录下,点击右键选git bash here
7.添加以下命令:git pull origin master --allow-unrelated-histories
8.在idea重新push即可