Intellij IDEA 提交代码到远程GitHub仓库
2019獨角獸企業重金招聘Python工程師標準>>>
1.下載github for window
http://windows.github.com/
2.設置相關綁定
Settings ?——Version Control——Git——Path to Git executable——選擇你的安裝目錄
C:\Users\Administrator\AppData\Local\GitHub\PortableGit_0f65d050d0c352fd38a0b25d82ee942deb19ef87\bin\git.exe
Test
Settings ?——Version Control——GitHub?
Host:github.com ?Login:賬號 ?Password:密碼
Test
3.項目的本地git提交
intellij內部集成了git版本控制 所以在本地可以直接進行使用
3.1創建本地倉庫
3.2提交代碼到本地git
右鍵項目或者文件?Git——Add——Commit (先add 然后再提交)
4.配置遠程提交
4.1 github上創建倉庫
4.2 Git Shell中配置遠程倉庫
cd?項目目錄git?remote?add?origin?https://github.com/lujianing/ueditor.gitgit?push?-u?origin?master
中間如果有報錯 請參考下邊的解決方法
1.fatal: remote origin already exists
git?remote?rm?origin2.error: Could not remove config section 'remote.origin'
需要修改gitconfig文件的內容?找到github的安裝路徑,我是
C:\Users\Administrator\AppData\Local\GitHub\PortableGit_0f65d050d0c352
找到一個名為gitconfig的文件,打開它把里面的[remote "origin"]那一行刪掉
重啟gitshell ?執行上述操作
4.3 Intellij IDEA中進行push/pull
右鍵項目 Git——Repository——Push?
在開發過程中 我們可以使用本地的git進行版本管理 ?最后使用push進行遠程提交
4.4 多人協作開發
在Github 項目的 settings——Collaborators 下可以添加項目成員
被添加的用戶 可以提交代碼到當前項目中
5.另一種簡單方法
在github上創建倉庫后 復制倉庫地址 比如?https://github.com/lujianing/demo.git
在intelij中 VCS——Checkout from Version Contrl——Git中 粘貼倉庫url地址
會從github倉庫中拷貝一份項目 ? 然后就可以在本地直接進行git操作
并且可以push到github倉庫中 (會提示你輸入github的倉庫和密碼)
轉載于:https://my.oschina.net/lujianing/blog/180728
總結
以上是生活随笔為你收集整理的Intellij IDEA 提交代码到远程GitHub仓库的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Invoke-Express 执行多个批
- 下一篇: 在ASP.NET MVC5中使用特性路由