选择需要的项目创建本地Git仓库
![](https://img-blog.csdnimg.cn/img_convert/88f67156fbadd459115aa6832d20fcf3.png)
![](https://img-blog.csdnimg.cn/img_convert/62d77ff758f5263b8126d2a7a3654328.png)
添加到暂存区
![](https://img-blog.csdnimg.cn/img_convert/3b405a24d46e3c3d4a7b71fb33f19ddf.png)
第一次提交
![](https://img-blog.csdnimg.cn/img_convert/6d6b96d1708ab0c91b15d4f5ee03762a.png)
或者点击这里
![](https://img-blog.csdnimg.cn/img_convert/f57c07d222901749784f8baa2a269f22.png)
写备注并commit
![](https://img-blog.csdnimg.cn/img_convert/2c248875c9fe55876c08dbd627d42bdf.png)
![](https://img-blog.csdnimg.cn/img_convert/a84ceac44de8055f41df554bc4976691.png)
推送远程仓库
![](https://img-blog.csdnimg.cn/img_convert/b1ddec80a1904ac09b16f4f90597ea67.png)
填写地址
![](https://img-blog.csdnimg.cn/img_convert/54c0941eb2a1b84b30dbf0670fbd2a10.png)
![](https://img-blog.csdnimg.cn/img_convert/3d1c64854f261981e3b1abfd32fd19f6.png)
![](https://img-blog.csdnimg.cn/img_convert/c425fe4d0e906b7e38e4a011a0b7bb78.png)
![](https://img-blog.csdnimg.cn/img_convert/d2f0d06bfa3b14e87f8f7a0417a7484e.png)
![](https://img-blog.csdnimg.cn/img_convert/69b21329cd7bc366f5e5403c64d7e3da.png)
解决上图警告
![](https://img-blog.csdnimg.cn/img_convert/4a1b039d4ec0b716bec0e464e6747077.png)
右键打开项目,输入
git pull origin master --allow-unrelated-histories
git push -u origin master -f
![](https://img-blog.csdnimg.cn/img_convert/48d90f115087a8b6e9ff70548f0fdb1d.png)
推送成功
![](https://img-blog.csdnimg.cn/img_convert/86b8841c7e85337467e568d4264e7268.png)
idea项目推送github及克隆github项目
创建仓库
![](https://img-blog.csdnimg.cn/img_convert/cc734a410ed6998cea3852239ec277fe.png)
![](https://img-blog.csdnimg.cn/img_convert/7b879f94e00564ab17c2662ffc939e64.png)
idea克隆
![](https://img-blog.csdnimg.cn/img_convert/bc6334deca756fbabe296cbd0d146c85.png)
![](https://img-blog.csdnimg.cn/img_convert/f48e8db223a7a1251eb70a35877192e2.png)
![](https://img-blog.csdnimg.cn/img_convert/2c4bfa44d72c117d98f02798548910e9.png)
![](https://img-blog.csdnimg.cn/img_convert/5e958bfc0d6d832783e8b9988a3e5203.png)
登录,成功克隆
![](https://img-blog.csdnimg.cn/img_convert/aee17814bbac6c767a549027cd0de2d3.png)
推送本地项目到远程仓库
和上述一样,地址变化了而已
推送失败打开git窗口输入
git config --global --unset https.proxy
git config --global --unset http.proxy