Qingquan-Li / blog

My Blog
https://Qingquan-Li.github.io/blog/
132 stars 16 forks source link

IntelliJ IDEA 提交代码到 GitHub #11

Open Qingquan-Li opened 7 years ago

Qingquan-Li commented 7 years ago

一、设置相关绑定

  1. Settings—>Version Control—>Git(提前下载好)—>Path to Git executable—>选择你提前下载好的的 git.exe 安装目录 1 git exe

  2. Settings ——Version Control——GitHub(Host:github.com,Login:账号,Password:密码 ) 2 github


二、配置远程

  1. Share Project on GitHub(上传项目到GitHub) : VCS—>Import into Version Control—>Share Project on GitHub share project on github

  2. Clone 克隆 GitHub 上的代码到本地: 在 GitHub 上创建仓库后,复制仓库地址,比如 https://github.com/FatliTalk/test , 在 IntelliJ IDEA 中 VCS—>Checkout from Version Control—>Git(或GitHub)中,粘贴仓库url地址(选择仓库),从 GitHub 仓库中 Clone 克隆一份项目,然后就可以在本地进行修改,然后再 Push 到 GitHub(见2.3)。 github

  3. IntelliJ IDEA 上 Push 修改后的代码到 GitHub: 选中项目—>右键—>Git—>Repository—>Push(在 Push 到 GitHub 之前,需 Add—>Commit 到本地仓库) PS:在实际开发过程中,我们还可以使用本地的 git(或者 GitHub 客户端)进行版本管理 ,最后使用push 进行远程提交。 push to github



——END

2629743986 commented 7 years ago

你好,请问一下,我按照你的方法点击 Share Project on Github 但是出现这个错误 Successfully created project 'FirstSpringBoot' on GitHub, but initial push failed: Could not read from remote repository. 我的项目名是FirstSpringBoot 而且git 和 github的配置我都设置成功了.

Qingquan-Li commented 7 years ago

@2629743986 你好,你在GitHub上成功创建了项目,但问题在于“初始推送失败:无法从远程存储库读取。” 我觉得可能是 GitHub 的问题,毕竟服务器在国外,有时候会连接失败,建议按照教程再作尝试。

2629743986 commented 7 years ago

恩,我再重新下载一个Git .谢谢

ghost commented 6 years ago

https://stackoverflow.com/questions/27566999/git-with-intellij-idea-could-not-read-from-remote-repository

fangx1129 commented 6 years ago

@FatliTalk sshexecutable 选择 Native

roceys commented 6 years ago

@2629743986 In IntelliJ IDEA go to VCS -> Git -> Remotes..., select row containing "origin" and click on edit button. If you host your repository on GitHub, replace your SSH URL from:

git@github.com:USERNAME/REPOSITORY.git

to:

https://github.com/USERNAME/FirstSpringBoot.git