用eclipse提交代码到github

170 篇文章 3 订阅
5 篇文章 0 订阅

用eclipse提交代码到github

1. 创建账号

2. 创建工程仓库

3. 创建仓库honey后,访问页面(https://github.com/automvc/honey)如下。还没发现有任何提交文件。url格式如下:https://github.com/{账号名称}/{仓库名}

页面的内容如下:

…or create a new repository on the command line

echo "# honey" >> README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/automvc/honey.git

git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/automvc/honey.git

git push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

Import code

 

 

4. 参照:…or create a new repository on the command line

提交一个文件,激活工程所在仓库.

https://github.com/automvc/honey.git 是仓库网址,要替换为自己的。

 

切换到工程目录,输入以下命令:

git init

git add README

git commit -m "first commit"

git remote add origin https://github.com/automvc/honey.git

git push -u origin master

 

D:\JavaWeb\workspaceGit\Honey>git init

Initialized empty Git repository in D:/JavaWeb/workspaceGit/Honey/.git/

 

D:\JavaWeb\workspaceGit\Honey>git add README

 

D:\JavaWeb\workspaceGit\Honey>git commit -m "first commit"

[master (root-commit) 95e2121] first commit

 1 file changed, 2 insertions(+)

 create mode 100644 README

 

D:\JavaWeb\workspaceGit\Honey>git remote add origin https://github.com/automvc/honey.git

 

D:\JavaWeb\workspaceGit\Honey>git push -u origin master

Username for 'https://github.com': honeysoft@126.com

Password for 'https://honeysoft@126.com@github.com':

remote: Invalid username or password.

fatal: Authentication failed for 'https://github.com/automvc/honey.git/'

注:若输错密码可以重新执行命令

D:\JavaWeb\workspaceGit\Honey>git push -u origin master

Username for 'https://github.com': honeysoft@126.com

Password for 'https://honeysoft@126.com@github.com':

Counting objects: 3, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 265 bytes | 265.00 KiB/s, done.

Total 3 (delta 0), reused 0 (delta 0)

To https://github.com/automvc/honey.git

 * [new branch]      master -> master

Branch 'master' set up to track remote branch 'master' from 'origin'.

 

 

5. 创建.gitignore文件:

将不用提交的文件或文件夹忽略,避免提交到仓库。

内容如下:

/.settings
/target
 

6.

用Eclipse提交工程。

工程右击选: 共享工程。

 

点击完成。

 

 

多了许多问号:

 

提交文件:

完成,点OK.

 

 

刷新网址,发现已成功提交文件。

 

7.

以后有Eclipse有文件修改,就可以直接用Eclipse提交文件到git了。

修改文件,文件多了一个>大于号箭头,表示有修改。

右击文件,选Team->Commit即可修改。

是不是比用DOS窗口直接,方便!

 

注:README.mdmd格式的说明文件。若是README则显示的为文本格式。

欢迎关注:https://github.com/automvc/bee或https://github.com/automvc/honey

<Bee 是一个十分钟即可上手的JAVA ORM框架>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值