本文共 908 字,大约阅读时间需要 3 分钟。
步骤
1.创建项目
2.在GitHub上创建一个仓库
首先登陆github.com 然后点击右上角账号左边的加号,点击New repository创建仓库。 Git上仓库就相当于项目的意思3.指定仓库名称
一般与项目名称相同4.创建成功,得到git地址
得到github地址:https://github.com/how2j/hiworld5.接着在本地创建一个项目hiworld,并且新建一个Java类
public class HiWorld { public static void main(String args[]){ System.out.println("Hi World"); }}
6.建立本地仓库
File->VCS->import into Version Control->Create Git Repository->e:\project\hiworld-OK7.把项目加入到本地仓库
右键项目->Git->Add8.提交项目
右键项目->Git->Commit Directory之后弹出如图所示的窗口,在Commit Message 输入 test, 然后点击 Commit And Push9.Push Commit
这里会询问你要提交的哪里去,点击Define remote,并输入在 创建成功,得到git地址 步骤中的:https://github.com/how2j/hiworld
然后点击push
10.查看GitHub
再次刷新github地址: https://github.com/how2j/hiworld 就可以看到都push上去了转载地址:http://nkpqb.baihongyu.com/