Put all text files that need to be versioned to your version control. This typically includes your src
directory, configuration files, pom.xml
files if you're using Maven, etc.
It is not a good idea to put binary files to your source control if they are large and/or change frequently and definitely don't put there generated files like target
. The reason is that version controls like git version file by tracking diffs between versions which doesn't work well for binary files. They clutter your history and often lead to huge repositories taking a lot of space with history of binary files.
There is no strict rule about binaries in version control, though. some people even support it. If your binary files are small and stable (e.g. images in a web project), it should be OK to just include them.
What to do about your binary files depends on what they are. There are repositories like Nexus for jar
packages. There are repositories for unix packages (e.g. rpms). If they are large files, put them to a dedicated location which is backed up.
The last option (that I admit to using once or twice too) would be setting up a different repository for your binary files and limit the history there so that it doesn't take up too much space but you would be just (kind of) misusing git as a backup tool.
You can also check out a few related questions:
Update after looking at your repository:
- Usually I don't put IDE settings (
.settings
, .project
, and .classpath
generated by Eclipse) to source control because they often change. Because nothing else contains the project information in your case, I would recommend using Maven instead.
- Move
bin/README.md
to your root directory.
- Remove
bin
directory. It contains duplicated images and .class
files. They are automatically generated by your IDE so they don't contain new information and change frequently.