myeclipse配置git提交项目步骤

来源:互联网 发布:淘宝联盟定金 编辑:程序博客网 时间:2024/06/05 04:24

一、搭建git环境

1.配置git环境
如果没有安装git客户端,请到https://git-scm.com/downloads下载最新版本
安装完成,运行Git Bash,在弹出终端进行如下配置:
git config --global user.name "您的名字"git config --global user.email "您的email"
检查配置:
输入下列命令可以正常显示user.name和user.email
git config -l
2.添加ssh公钥
您已经添加了公钥
3.拉取代码库到本地
示例如下,其中git@codehub.devcloud.hwclouds.com:***/***.git为拷贝的仓库地址url。
ssh协议:git clone git@codehub.devcloud.hwclouds.com:***/***.git
注:
windows用户推荐使用tortoisegit GUI工具作为辅助工具,请到官网下载最新版本安装https://tortoisegit.org/download/

二、在myeclipse中使用git

1. 新建gitspace作为工作空间

2. 导入代码:

在Package Explorer中右键import-->Git-->Project from Git-->Existing local respository-->之前clone的代码处

3. 导入myeclipse配置文件

    在Package Explorer中右键import-->Generel-->Preferences-->myeclipse.epf,见附件

4. 在Package Explorer中右键maven4MyEclipse-->upload projects,以更新引入的工具包

三、修改代码并提交

1. 在被修改文件名称上,右键Team-->Add to Index

2. 在被修改文件名称上,右键Team-->commit-->输入变更备注信息message,选中提交文件,然后commit,以提交到本地仓库

3. 在项目上名称上,右键Team-->remote-->push 提交到服务器

以上是myeclipse的提交流程,但是我本地配置有问题,我的将本地提交到服务器的步骤只能通过git bash命令手动提交
1. git status:找到有差异的文件

2. git diff file.html:比较文件中差异的内容

3. git add <path>: 新增文件

4. git commit -m "file.txt":将修改的文件提交到本地仓库

5. git push origin master:将本地仓库master推送到远程服务器

原创粉丝点击