在Idea中创建项目,直接提交到Git远程仓库步骤

因为这个问题,我恐怕累计已经浪费了我七八个小时。真的好烦,这次终于把步骤完全弄会了。现在就来记录怎么使用Idea来提交新创建的项目到GitHub上。

参考地址:git上传本地Idea项目


1.创建本地Git仓库

        点击下面的红色按钮后,将项目名添加到本地仓库。

        VCS-Import into Version Control - Create Git Repository



2.提交代码到git

        右击项目名,Git ----add 。这步相当于在添加。



3.在GitHub上创建仓库


4.在本地项目下开启git bash 命令

        输入

        git remote add origin https://github.com/hairdryre/XXXXXX.git

        git add .   出现警告,那就对了!

        git commit -m "init project"

        git push -u origin master

5.输入帐号密码

        根据提示输入GitHub的帐号与密码 

        打开Idea中测试,品尝喜悦!   

posted @ 2022-07-17 12:15  小大宇  阅读(1192)  评论(0编辑  收藏  举报