如何禁用netbeans 7.0的自动.gitignore修改?

dgA*_*ien 9 git netbeans netbeans-7

我喜欢干净简单的文件/代码.所以,我使用的是全局.gitignore,具体取决于机器设置(IDE&|| OS Specific ...).摘抄:

# exclude OSX Files
.DS_Store
# exclude Logfiles
*.log
# exclude Netbeans project files
/nbproject
Run Code Online (Sandbox Code Playgroud)

Netbeans git支持正在改善,这没关系,但自从7.0 NB以来它让我发疯了.

每次我修改项目中的代码时,NB都会修改项目.gitignore并添加:

/nbproject
Run Code Online (Sandbox Code Playgroud)

到gitignore.

如何在不停用git支持的情况下阻止Netbeans执行此操作?

A T*_*A T 1

正如 VonC 所说,这是 git 模块的问题,而不是你能做的任何事情(除了编写补丁)

我建议您给这个问题加注星标:http://code.google.com/p/nbgit/issues/detail ?id=74

并等待回复。

另外,我对源代码不太熟悉,但是您可以在等待修复时执行低效的解决方法:

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

只需使用 if(gitInfoExclude==) 编辑上面的内容,然后放入要添加的目录异常即可。