Create a new project in Eclipse ideLesson4.
Right click you project in the package explorer. Find
Select Git, click Next
Click Create …
Give your a repository a name and then click Finish.
Click Create Repository. The package explorer should after a refresh show the repository name in square brackets.
In Git as in other similar systems, you must decide what you place under it's control. Regarding project development you are interested in maintaining source code integrity between versions. Therefore you are interested in Git managing source code, not binary code for execution. In order to achieve this, you must create a file .gitignore in your project folder. The file content:
bin
and nothing else. This means that the bin subfolder of your project will be ignored by Git. In other words Git will look into src.
Right click and then Team->Add to index. There will be an asterisk next to the project name. Then right click and Commit.
Check with Team->Show in history.
Now finally, in your project: in a package helloGit create a new class GiTest
<xi:include></xi:include>
Once the class is in place, you may want to commit it to the repository. You will want to do the same after changes. Team->Commit gives you:
If there has been no changes you will get:
The repository file structure now in place, looks as follows
nml@mymb ~/git $ tree ideLesson4n
ideLesson4n
└── ideLesson4n
├── bin
│ └── helloGit
│ └── GiTest.class
└── src
└── helloGit
└── GiTest.java
5 directories, 2 files
nml@mymb ~/git $