Eclipse Add Egit method

Source: Internet
Author: User

1. Install Egit, one of the methods:

2. Create a new Javaweb project to test the use of Git.

L File > Team > Share Project Choose Git

How to select the Create Repository create a warehouse. Then select Done.

At the same time, project in Eclipse builds git versioning, where no branch is created and is in the No-head state.

The symbol in the folder "?" Indicates that the folder is in a untracked state so that the GIT repository is created successfully.

The effect is as follows:

After the warehouse is created, the. git folder in the $workspace\demo directory is the repository address for git. Unlike CVS and SVN, Git does not create a version control folder in each directory, only the repository under the root directory.

3. Configure the. gitignore file to exclude unnecessary version control files.

At this point we try to do a commit

L-Team--Commit ...

By the above we see that there are quite a few files that are not written by us and these files do not need to be versioned.

How do I get rid of these files?

We can configure the. gitignore file by configuring the.

And then re-commit, the effect is as follows:

After the first commit, the master branch is automatically generated:

Observe the local repository.

Then add a class to the test package

You can see that the icon remains a question mark, in the untracked state, where git does not monitor the file

You can add a file to the GIT index for version monitoring by using team-, add to Index

You can see that the icon display has also changed (in Egit, you can add the untracked file to the index by default and commit the update without having to separate the operation)

You can also exclude files from index control by using team---untrack.

Eclipse Add Egit method

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.