从Idea上传项目到Github

1.创建有github账户:https://github.com

2.在电脑上安装git

3.在idea中配置git和github

(1)配置github,host为github主机地址,账号密码为自身登录帐号密码,点击test进行测试

(2)配置git,path路径为下载的git的可执行文件,点击test进行测试

4.在idea的Terminal命令行窗口中输入(假设是第一次上传项目到github)

(1)创建本地的仓库:git init

(2)将项目上传到本地仓库:git add .(注意add后空一格有个.)

(3)将项目提交到仓库:git commit -m"xxx"(其中xxx为此次提交的注释内容)

(4)在github上创建一个新的仓库,将会出现以下界面

(5)连接本地仓库与远程仓库:git remote add origin xxx(xxx为显示的https)

(6)将代码push到github上:git push

以上为使用命令行的方式上传代码到github上

猜你喜欢

转载自blog.csdn.net/szt292069892/article/details/84256059