一、搭建git环境
git config --global user.name "您的名字"
git config --global user.email "您的email"
git config -l
ssh协议:git clone git@codehub.devcloud.hwclouds.com:***/***.git
二、在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推送到远程服务器
本文详细介绍了在myeclipse中配置git并进行项目提交的步骤,包括搭建git环境、导入项目、更新工具包,以及如何修改代码并提交。在myeclipse中,可以通过Team菜单进行提交和推送操作。然而,由于作者遇到本地配置问题,目前只能通过git bash手动完成从本地到服务器的提交流程,涉及git status、git diff、git add、git commit和git push等命令。

1165

被折叠的 条评论
为什么被折叠?



