Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the automatic .gitignore modification of netbeans 7.0?

I like clean and simple files/code. So, I am using a global .gitignore depending on the machine settings ( IDE &|| OS Specific...). excerpt:

# exclude OSX Files
.DS_Store
# exclude Logfiles
*.log
# exclude Netbeans project files
/nbproject

Netbeans git support is improving and that's ok, but since 7.0 NB it is driving me crazy.

Every time I modify code in my project NB modifies the projects .gitignore as well and adding:

/nbproject

to the gitignore.

How do I stop Netbeans doing this, without deactivating the git support?

like image 835
dgAlien Avatar asked Jul 20 '11 11:07

dgAlien


People also ask

How do I force a file to be added to gitignore?

It is possible to force an ignored file to be committed to the repository using the -f (or --force) option with git add: $ cat.gitignore *.log $ git add -f debug.log $ git commit -m "Force adding debug.log" You might consider doing this if you have a general pattern (like *.log) defined, but you want to commit a specific file.

How do I test gitignore?

Each pattern in a particular.gitignore file is tested relative to the directory containing that file. However the convention, and simplest approach, is to define a single.gitignore file in the root. As your.gitignore file is checked in, it is versioned like any other file in your repository and shared with your teammates when you push.

How do I ignore a file in Git?

Ignored files are tracked in a special file named .gitignore that is checked in at the root of your repository. There is no explicit git ignore command: instead the .gitignore file must be edited and committed by hand when you have new files that you wish to ignore.

What are hidden files in gitignore?

hidden system files, such as .DS_Store or Thumbs.db personal IDE config files, such as .idea/workspace.xml Ignored files are tracked in a special file named .gitignore that is checked in at the root of your repository.


1 Answers

As VonC said, this is an issue with the git module, not with anything you can do (except write a patch)

I recommend you star this issue: http://code.google.com/p/nbgit/issues/detail?id=74

And await a response.

Also, I am not too familiar with the source code, but you could do an inefficient workaround while you wait for a fix:

    private PathPatternList getRepoPatternList() {
        File gitInfoExclude = new File(new File(repo.getDirectory(), "info"), "exclude");
        return getPatternList(gitInfoExclude, "");
    }

Just edit the above with an if(gitInfoExclude==) and then put in the directory exception you want to add.

like image 164
A T Avatar answered Oct 09 '22 02:10

A T