如何合并code在Eclipse [英] How to merge code in Eclipse

查看:185
本文介绍了如何合并code在Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何点缀在Eclipse以下?

How do I dot the following in Eclipse?

我创建Eclipse的一个Android应用程序项目,我一直在使用例如:It和到位桶版本控制下把这个(同样,我不知道这是形容它,因为我是新来的版本控制的最佳方式)。我已经写了一些code并提出了一些承诺至今。我已邀请谁加入该项目的朋友。昨晚,他们改变了一些code的。

I have created a Android app project in Eclipse and I have put this under version control using eGit and BitBucket (again I don't know if this is the best way to describe it as I'm new to version control). I have written some code and made several commits so far. I have invited a friend who has joined the project. Last night they changed some of the code.

今天我火了Eclipse和希望继续该项目的工作,而是希望从他们离开的地方开始。我右键单击该项目,并去团队 - >同步(只是因为这在我看来是最合乎逻辑的步骤)。什么都没有发生,因为我害怕。

Today I fire up Eclipse and want to continue working on the project, but want to start from where they left off. I right click on the project and go to Team -> Synchronize (simply because this seemed the most logical step to me). Nothing happened as I feared.

如何获得最新版本的工作code的到我的本地机器?当我完成了我的工作,我只是犯,因为我一直在做右击项目,然后去:团队 - >凯明其次是团队 - >推到上游

How to I get the latest version of the working code onto my local machine? And when I am finished my work, do I just commit as I have been doing by right clicking project and then going to: Team -> Commit followed by Team -> Push to Upstream?

推荐答案

在Eclipse中,开始使用Git仓库管理器的角度来看,和Git的分期视图。

Within Eclipse, start using the Git Repository Explorer perspective, and the Git Staging View.

信息库资源管理器显示您的克隆,让你看到你的分支机构,变更记录等,您可以在克隆的姓名权鼠标选择拉。这将获取从到位桶服务器的更改,然后将它们合并到本地分支。

The repository explorer shows your clone, allowing you to see your branches, your change history etc. You can right mouse on your clone's name and choose pull. This will fetch changes from the Bitbucket server and then merge them to your local branch.

请注意,你不应该拉,直到你要么藏匿任何本地修改的文件,或让他们致力于您的分支。如果拉冲突的任何地方变更的行为将被拒绝。

Note you should not pull until you have either stashed any locally modified files, or have committed them to your branch. If the pull conflicts with any local changes the action will be rejected.

由于您与您分享应该考虑通过配置分支修改本地(主?)分公司其他人的一个分支...使变基选项。这意味着当您在合并本地分行远程更改,任何传出提交被重播了进​​来的人的顶部。这意味着,当你推你避开那些可能会搞乱了历史合并分。鼓励其他人在自己的工作回购也这样做。

As you are sharing a branch with other people you should consider modifying your local (master?) branch via Configure Branch... to enable the Rebase option. This means when you merge remote changes over your local branch, any outgoing commits are replayed over the top of the incoming ones. It means when you push you avoid merge points which can clutter up the history. Encourage other people working in their own repos to do likewise.

其次,当你提交更改,学会使用Git的临时视图。这可以很容易地拖放变化,在一个单一的去提交它们。您也可以从团队做到这一点|添加和团队|提交...但IMO这是更为笨拙。

Secondly, when you are committing changes, learn to use the Git Staging view. This makes it easy to drag and drop changes and commit them in a single go. You can also do this from Team | Add and Team | Commit... but IMO this is far more clumsy.

当您准备好让别人看到你提交的修改必须把他们。通常你会在一个项目或者鼠标右键并选择团队|推到上游或去库资源管理器,鼠标右键在克隆和选择推到上游。如有必要,您可能要拉之前,你可以把因为服务器会拒绝改变,如果他们没有满足合并

When you are ready for others to see your committed changes you must push them. Normally you would either right mouse on a project and choose Team | Push to upstream or go to the repository explorer, right mouse on the clone and choose Push to Upstream. If necessary you may have to pull before you can push because the server will reject changes if they do not satisfy merge

这是在Eclipse中使用Git的基本工作。作为一个普遍的观点,也确保了例如:It插件的版本至少是2.3.1或3.0.1根据您的Eclipse版本。

This is the basic workflow of using Git within Eclipse. As a general point, also ensure your version of the EGit plugin is at least 2.3.1 or 3.0.1 depending on your version of Eclipse.

这篇关于如何合并code在Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆