AgostinoX
AgostinoX

Reputation: 7683

NetBeans git init ignore directories dist and build even if they are not in .gitignore

I have two identical java NetBeans projects A and B; A is managed via git command line, B via Netbeans git integration.

A: via command line
git init
git add .

B: via NetBenas IDE (tested on version 7.3)
Team, Git, Initialize
Team, Git, Add

Results

A: all dir and files are tracked
B: all tracked but build/, dist/, nbproject/private/ directories.

This may also suit me, but I would rather decide myself.
So I searched the .gitignore file that NetBeans must have created in order to ignore such files. But it doesn't work like this: it seems that it ignores build and dist directories on the basis of a non standard git entry, but something that comes from NetBeans.
Where is this Netbeans setting? I found the one shown in the screenshot above in the Netbeans options.
Unfortunately, once i've unchecked this flag, the result is ever the same (even if i start a new project from scratch!).
At this point the question is: how do i inlcude dist files (if I wanted to) in git tracked files with netbeans git client?

enter image description here

Upvotes: 3

Views: 1900

Answers (1)

patrickGranite
patrickGranite

Reputation: 76

I have the same problem and so far the only workaround that I've found is to open a git shell in the project folder and add the folder manually.

git add dist
git commit -m "dist added"

After this, you will be able to push your changes as usual from the netbeans IDE.

However I don't encourage such a thing as saving the dist folder. I believe it is more interesting to leave the code on the remote repo and have an automated building job that takes the code and makes the .jar.

Hope this helps!

Upvotes: 2

Related Questions