Reputation: 3
I'm trying to versioning a Netbeans Project. So I keep in my remote repo:
The point is that I don't want to update nbproject files after every build/commit. Updating the properties is necessary only when I make big changes, like adding a new library (in all other cases cloning the project with the same old folder work). At first I pushed a commit with the 2 working directories, after that I modified and committed the .gitignore adding /nbproject , so the others can clone the project without references/properties problems and commit source changes without updating the nbproject files. The idea of my team is that every time there is a big change to do (like adding a new library to the project), the commit should be done manually from git bash forcing the nbproject folder to update, in all other cases instead (most of the times) it can be safely done using NetBeans changing and committing only the source.
The problem is occured when I needed to add a library. Infact after the addition of the .jar and code changes I went to check what git saw from bash, this is the output of git status
:
$ git status
# On branch newVersioning
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working dire
#
# modified: ****/nbproject/project.properties
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# lib/**************.jar
# ****/src/***/***********/****.java
no changes added to commit (use "git add" and/or "git commit -a")
I don't understand why git can see (without any type of forcing) the change of the file project.properties that it should automatically ignored by versioning. This is the .gitignore line
****/nbproject/
Upvotes: 0
Views: 902
Reputation: 9217
.gitignore
only works for untracked files. Your project.properties
file has already been added and committed to your Git repository, so it will not be ignored.
See this question for a way to work around this limitation.
Upvotes: 3