您的位置:首页 > 编程语言 > Java开发

eclipse安装git,上传和下载详解

2016-06-17 23:54 253 查看
git的使用意义

为github而生:使用建议:when you upload file or edit,do commit and  描述一下 resons;fork

sb's work to find and fix the problem and then pull request till others merge your solution.

一、安装插件

菜单栏Help --> Install New Software...-->>在Work with中输入http://download.eclipse.org/egit/updates-->>勾选Eclipse Git Team

Provider和JGit-->>点击Next,进入安装,重启Eclipse

二、配置Git

菜单栏Window -> Preferences -> Team -> Git -> Configuration,点击Add Entry...,添加name和email

例如:username  wangwanchao ; useremail gggeek@163.com

登录GitHub后点击右下角的New repository按钮添加项目代码仓库-->>输入Repository name(建议与要提交的项目名同名)

三、关联Git

注意:1、第一步如果出错,cannot  read file /.gitconfig,直接找到该文件删除即可  

         2、如果以前已经安装使用过Git提交项目到Github,第一步可以直接加载以前生成的SSH密钥

1、在Eclipse中生public key, 并添加到GitHub Repository中。

在菜单栏依次打开window → preference → general → network connection → SSH2 → Key Management → generate RSA Key... → apply → save private key...

2、关联Git。鼠标选中要发布的项目,单击右键,Team -> Share Project,选Git,点击Next。勾选Use or create repository in parent

folder of project,选中要发布的项目,点击Create Repository,点击Finish完成。

3、发布项目。鼠标选中要发布的项目,单击右键,Team -> Commit,填写Commit message,勾选全选,点击Commit提交。注意:此时,

是提交在本地Git,还需要Push才能提交到GitHub中。

4、发布到GitHub。鼠标选中要发布的项目,单击右键,Team -> Remote -> Push,粘贴URI(https://github.com/wangwanchao/WaterMark.git),填写User(wangwanchao)和Password(xxxxxx),点击Next;点击

Source ref的下拉框,选择master,默认master,点击Add Spec,点击Finish,点击OK完成。

5、从Github更新项目

从GitHub中取得项目代码。菜单栏Window -> Show View -> Git -> Git Repositories,点击OK;在Git Repositories视图中,点击图示按钮,进入Clone Git Repository对话框;填写URI,User,Password,点击Next;点击Next;选择要保存的路径,点击Finish。至此,项目代码就被下载到指定目录下了,需要使用的时候通过Eclipse Import进来即可。

四、具体操作和细节处理链接:http://my.oschina.net/u/2608629/blog/672760?p={{currentPage-1}}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: