IDEA上传一个项目到github中已经创建好的仓库中

                                IDEA上传一个项目到github

一。idea的配置

1.打开idea设置setting

IDEA上传一个项目到github中已经创建好的仓库中

2.点击ok,然后添加一个git创库

IDEA上传一个项目到github中已经创建好的仓库中

3.选择你所要上传的项目,然后项目会变红

IDEA上传一个项目到github中已经创建好的仓库中

4.添加到git

IDEA上传一个项目到github中已经创建好的仓库中

此时项目变绿

IDEA上传一个项目到github中已经创建好的仓库中

6.提交到本地

IDEA上传一个项目到github中已经创建好的仓库中

二。git**配置

1.打开git dosc命令输入ssh-kegen -t rsa -C "邮箱地址"

IDEA上传一个项目到github中已经创建好的仓库中

2.打开**将**存放到github的ssh keys上:

    1.将id_rsa.pub打开复制

IDEA上传一个项目到github中已经创建好的仓库中

    2.设置git 的ssh keys

IDEA上传一个项目到github中已经创建好的仓库中

    3.添加完成后

IDEA上传一个项目到github中已经创建好的仓库中

3.添加完成后,在本地git中验证 输入命令    ssh -T [email protected]

IDEA上传一个项目到github中已经创建好的仓库中

IDEA上传一个项目到github中已经创建好的仓库中

三。在git中创建一个仓库

IDEA上传一个项目到github中已经创建好的仓库中

四。将本地git项目传到github上

进入工程文件夹所在目录,右键git bash here。

输入一下命令

git init

git remote add origin [email protected]:{github用户名}/{repository名}.git

git pull [email protected]:{github用户名}/{repository名}.git

IDEA上传一个项目到github中已经创建好的仓库中

添加

通过命令git add .

.是指项目的所有文件

IDEA上传一个项目到github中已经创建好的仓库中

-m"这里指对项目提交的描述,如Hibernate的学习与测试"

提交完成后在idea中pull,推送到github

IDEA上传一个项目到github中已经创建好的仓库中

将所有文件选中点击推送,我这里已经弄过一次了

IDEA上传一个项目到github中已经创建好的仓库中

然后看看网页。

IDEA上传一个项目到github中已经创建好的仓库中