1.安装
方法一:在eclipse中,Help - Eclipse Marketplace... Find egit 查找后 install。
安装完成后重启。

方法二:
Eclipse—》Help—》Install New Software.-->点击"add"选择文件-->
选择“Archive”选择安装文件,最后点击“OK”-->
展开“Eclipse Git Team Provider”,勾选“Eclipse EGit”选项即可,点击Next-->
点击“Next”-->
选择 “I accept。。”,点击“Finish”-->
eclipse restart now 即可,重启后window--preference--Team--git出现即说明安装成功
2.从远程git克隆
在window--preference--Team--git--Configuration--User Setting 设置user.name和user.email
右键空白处--import--Git--projects from Git

选择URI点next--在弹出的对话框URI选择仓库 xxx/shared.git--点next,在Directory选择客户端目录,我的是在目录D:\gitwork\ethan
点next,选import as a general project

点next,
此时状态为黄色小桶,搞定
3.修改index.jsp后,状态有个箭头

右键index.jsp--Team--Add to Index此时状态为星

右键工程--Team--Commit...此时状态为黄色小桶,工程右边有个向上的箭头

右键工程--Team--Remote--Push 弹出的对话框里source ref为master到master,点add spec,点next此时状态为黄色小桶,可能有向上箭头没有关系
push的时候有冲突的话,会拒绝,此时pull,状态为红色

解决冲突,右键index.jsp--Team--Merge Tool --选择use Head...解决,此时仍为红色

右键index.jsp--Team--add to index 此时变为星号,然后commit,push
本文详细介绍了在Eclipse中安装Git插件的两种方法,包括通过Eclipse Marketplace和手动安装的方式,并提供了从远程Git仓库克隆项目的步骤。此外,还讲解了如何在Eclipse中设置Git用户信息,以及进行文件修改、添加、提交和推送等基本操作。
293

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



