步骤 1 : 创建项目
步骤 2 : 首先在github创建一个仓库
步骤 3 : 制定仓库名称
步骤 4 : 创建成功,得到git地址
步骤 5 : 接着在本地创建一个项目
步骤 6 : 建立本地仓库
步骤 7 : 把项目加入到本地仓库
步骤 8 : 提交项目
步骤 9 : Push Commit
步骤 10 : 查看github
步骤 2 : 首先在github创建一个仓库顶折
首先登陆github.com
然后点击右上角账号左边的加号,点击New repository创建仓库。
Git上仓库就相当于项目的意思
Intellij IDEA)- git - 创建项目

首先在github创建一个仓库
步骤 3 : 制定仓库名称顶折
这里输入仓库名称hiworld
Intellij IDEA)- git - 创建项目

制定仓库名称
步骤 4 : 创建成功,得到git地址顶折
得到github地址:https://github.com/how2j/hiworld

创建成功,得到git地址
Intellij IDEA)- git - 创建项目

步骤 5 : 接着在本地创建一个项目顶折
接着在本地创建一个项目hiworld,并且新建一个Java类
Intellij IDEA)- git - 创建项目

接着在本地创建一个项目
1
2
3
4
5
public class HiWorld {
public static void main(String args[]){
System.out.println(“Hi World”);
}
}
步骤 6 : 建立本地仓库顶折
菜单->VCS->import into Version Control->Create Git Repository->e:\project\hiworld-OK
Intellij IDEA)- git - 创建项目

建立本地仓库
步骤 7 : 把项目加入到本地仓库顶折
右键项目->Git->Add
Intellij IDEA)- git - 创建项目

把项目加入到本地仓库
步骤 8 : 提交项目顶折
右键项目->Git->Commit Directory之后弹出如图所示的窗口,在Commit Message 输入 test, 然后点击 Commit And Push
Intellij IDEA)- git - 创建项目

提交项目
步骤 9 : Push Commit顶折
这里会询问你要提交的哪里去,点击Define remote,并输入在 创建成功,得到git地址 步骤中的:

https://github.com/how2j/hiworld

然后点击push
Intellij IDEA)- git - 创建项目

Push Commit
步骤 10 : 查看github顶折
再次刷新github地址:
https://github.com/how2j/hiworld
就可以看到都push上去了
Intellij IDEA)- git - 创建项目

查看github

相关文章: