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