This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269217

Summary: Git push ignoring .gitignore
Product: versioncontrol Reporter: nestoracevedo <nestoracevedo>
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: git
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description nestoracevedo 2016-12-02 19:13:38 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Linux version 3.16.7-48-desktop running on amd64
Java; VM; Vendor = 1.8.0_92
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.92-b14

Reproducibility: Happens sometimes, but not always

STEPS:
  * Right click on project, Git->add
  * Right click on project, Git->commit and add message. On list I don't see ignored files via .gitignore
  * Right click on project, Git->remote->push to upstream

ACTUAL:
  sometimes ignored files via .gitignore are already ignored, sometimes not

EXPECTED:
  files ignored via .gitignore should not be pushed on commit
Comment 1 nestoracevedo 2016-12-02 19:13:42 UTC
Created attachment 163134 [details]
IDE log
Comment 2 Ondrej Vrabec 2016-12-05 16:03:16 UTC
Are you saying that even though the files are ignored by .gitignore, they are committed into the repo when you do Git->Commit? What is the pattern inside .gitignore? And what is the file's path?
Comment 3 nestoracevedo 2016-12-13 18:27:06 UTC
(In reply to Ondrej Vrabec from comment #2)
> Are you saying that even though the files are ignored by .gitignore, they
> are committed into the repo when you do Git->Commit? What is the pattern
> inside .gitignore? And what is the file's path?

Yes, I had to put a new .gitignore inside the directory where files to be ignored resides currently to ignore them.

Files full path are: 
/home/my-directory/public_html/app/config/app.php
/home/my-directory/public_html/app/config/session.php
/home/my-directory/public_html/app/config/cache.php

So in the .gitignore file on root project I had:
app/config/app.php
app/config/session.php
app/config/cache.php

Doing a git via konsole these files are correctly ignored but Netbeans tracks constantly the files on git add - git commit on IDE, then when they are listed on commit dialog I had to uncheck these files for ignoring.