Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add .jar files into a git repository

Tags:

java

git

github

I have a project on eclipse where recently i created a new folder called lib and added some .jar files inside. I cannot seem to commit the changes to git. It just doesnt appear in the tracked list of files.. I have removed .jar from .gitignore in my branch and commited the changes, and still the same.

like image 764
Yini Avatar asked Oct 16 '16 09:10

Yini


3 Answers

The way I got it working for me was -

git add --force /path/to/the/NAME_Of_THE_JAR.jar
like image 169
R11G Avatar answered Oct 03 '22 14:10

R11G


in the .gitignore file present in your project, you need to make sure that you allow *.jar files to be pushed. In my case, *.jar files was listed in ignore list. So I removed it from that list and git was able to detect it and I was able to push it.

like image 32
Mohit Garg Avatar answered Oct 03 '22 13:10

Mohit Garg


You put your files in the project package, but you didn't put them under version control. All you need is to add them to VCS by "git add" command. Here is good documentation.

You should use this command in git bash or in terminal (if you have added git to path)

Also I recommend you to use build manager as Maven, Gradle or Ant to add you dependencies. Good luck!

like image 40
mchern1kov Avatar answered Oct 03 '22 13:10

mchern1kov