I need to add the file to the repository and then commit it from my java project. I use 

Runtime.getRuntime().exec("C:\\Program Files (x86)\\Git\\bin\\sh.exe");


to start git but what should I do next?


Question: Why are there so many different types of screws (phillps/flat/hex/star/etc)?
Answer: First, I really like Eric's answer for practical reasons.  But there is another side to screw head diversity:  Security.

In the end, it's usually a temporary measure.  Once a company invents a new screw, some third party will start selling tools to remove them.  But for a time, any new screw design means the only people who can open your parts are "certified" workshops you've given tools to.  Personally I see this a lot in electronic equipment, where the original manufacturer wants some aspect of design kept private or doesn't want after-market mods made to things they sell.  Nintendo is particularly active in inventing new screws.

Examples of security screws include 3-prong Torx variants, and Allen heads with a raised dot in the middle of the screw head to stop standard Allen wrenches from fitting.

If you'd like to see a much more industrial version, find a car which has been booted and look at the bolt.  I've seen circular bolt heads with an off-center circular hollow inside.  No shoulders or slots to grab, you have to have a very specific wrench.  And, of course, there are security lug nuts for car tires.