1. 程式人生 > >idea介面化整合git建立初始化本地庫並提交遠端庫

idea介面化整合git建立初始化本地庫並提交遠端庫

準備工作:

1:github或者碼雲建立自己的遠端的倉庫:

https://github.com/*******/huashan.git

2:idea建立本地maven專案:

3:建立本地倉庫,

4:指定倉庫的地址:https://github.com/******/huashan.git

5:可以正常的add專案、commit 到本地庫、push到遠端庫,我的報了一個錯誤:

錯誤資訊:

Can't finish GitHub sharing process
            unable to read askpass response from 'C:\Users\username\.IntelliJIdea2016.3\system\tmp\intellij-git-askpass25.bat'
            failed to execute prompt script (exit code 1)
            could not read Username for 'https://github.com': No error

 

修改如下:

1:cd .git/

2:vi config  ----->修改如下:https://[userName]:[password]@github.com/project.git

3:如果報錯誤資訊:push to origin/master was rejected意思大概就是遠端提交被拒絕之類的執行如下的命令:

解決方案如下:

切換到自己專案所在的目錄,開啟終端視窗,執行如下命令:

git pull

git pull origin master

git pull origin master --allow-unrelated-histories

命令執行完畢後,在idea中重新push自己的專案,成功!!!

之後再通過idea執行push就成功了。一點點的經驗。總結一下