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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With