Eclipse Egit methods for updating uncommitted files

Source: Internet
Author: User

Problem

Previously used SVN in the project: It feels really good, whether it's cutting branches, merging branches, editing conflicts, or updating code. Now git is used in the new company project ... Although I have used it myself, but the cooperation of many people has been useless. So I met a very painful problem Baidu has no answer, and today stumbled upon a solution.

There must be a lot of configuration files in the project, often some students accidentally upload their own configuration, I have modified this configuration and I do not intend to submit, but the new version submitted by others have this file, and then the entire version I can not pull down, because it will be prompted that the current changes will be overwritten.

Solutions

For example, I have such a file.

Eclipse, but not commit.

Then I modify and submit the remote in the other warehouse.

At this point the pull code will error (with the merge operation in the Repository Sync view).

Because this file is not submitted. Reset I certainly do not want to do, because my changes will be gone. I don't want to do it because I personally configure the version that I don't want to upload to the server.

So the choice of stash is to temporarily save the current file.

At this point, the Java file in eclipse will be restored, and one more stash record will be saved with the files previously restored.

Because this time the file has been restored, as well as the previous version of the history of the same, so can pull. We do pull.

After the update is complete: We can then pop out the file that we just stash.

In the previous [email protected]{0} above right click on apply stashed changes

will prompt for conflicts. It's normal. Without a conflict, we could pull it off before. You don't have to stash ...

You can edit the conflict by right-clicking on the Testgit mergetool.

The left file is submitted by someone else, and the right side is my stash.

After editing, right-click Testgit Select Mark as merged OK

This is the time to successfully update someone else's code, and did not submit their own changes ...

Feelings

1. I feel it's still svn ... You can choose not to update this profile directly, use your own local configuration, and update the other files in the version (it is possible that I do not know git is not familiar with this feature)

2. The merger is not as good as SVN. SVN can also list the server version in Eclipse, my version, the merged version, I can't operate in egit, use external tools, such as Beyondcompare. But then the code coloring function is gone. It hurts.

3.stash seems like a good use, you can cache a bunch of files, you can also have n stash which will pop up which ... This is really good, I can stash n different configurations ... Just don't know if this is the right way to use ...

Eclipse Egit methods for updating uncommitted files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.