1

Doing git status returnsnothing to commit, working tree clean but Netbeans project/files sidebar indicates folders and files Contains add/modified or deleted files which means Netbeans thinks there are files in the folder that are not commited.

Any ideas how to "sync" git status with Netbeans?

IMB
  • 15,163
  • 19
  • 82
  • 140
  • Please, update your question with more information: [1] Which version(s) of NetBeans? JDK? [2] Wich version of CLI Git? [3] Also if you can provide the output of git log from CLI Git and Git History from NetBeans (right-click on the project -> git -> show history -> Search). [4] If you can describe what actions have you done before the issue happend? – Dmitry.M Mar 18 '20 at 10:49
  • @Dmitry.M I am using latest Netbeans/Git. Basically no matter where I look in Netbeans, it doesn't match with Git. This happened to me before and I'm just using NB normally. The only solution so far is to delete the project altogether, start a new blank slate then `git pull`. But I don't want to do that again in the future in case it happens happen. – IMB Mar 18 '20 at 13:15
  • this could be a [bug](https://issues.apache.org/jira/browse/NETBEANS-4005) – Dmitry.M Mar 18 '20 at 13:36
  • @Dmitry.M Yeah, it looks like it. That's similar to what I'm experiencing. – IMB Mar 18 '20 at 13:49
  • updated the answer. – Dmitry.M Mar 18 '20 at 17:36

1 Answers1

1

NetBeans 11.3 or 11.2

It could be a bug. It was introduced in NetBeans 11.3 or 11.2 when implementing this improvement (updating jgit to 5.5.0). There is a pull request and probably it will be merged either in 12.0 or 12.1.

Other versions

Sometimes for a big project, NetBeans doesn't automatically refresh statuses. For me manually asking for status refreshing usually helps.

For refreshing go to the file or project or the parent folder, right-click on the mouse -> git -> show changes -> and click refresh statuses.

enter image description here

Dmitry.M
  • 2,833
  • 1
  • 17
  • 30
  • @IMB, does NetBeans show any modified, added or deleted files in "Show Changes" window? Please, try checking status with "Changes Between HEAD and working tree" option. – Dmitry.M Mar 17 '20 at 19:19
  • Yes it does show files in the "Changes Between HEAD and working tree" option but all the files listed there are already committed in the `git status ` of the "official" Git CLI. – IMB Mar 17 '20 at 19:41
  • What is the version of NetBeans? Assuming that official client is correct it could be a bug. I would suggest clearing the [cache](https://stackoverflow.com/a/17238597/5681468). – Dmitry.M Mar 17 '20 at 19:54
  • I'm using the latest, 11.3. I tried that link, clearing cache, didn't work sorry. – IMB Mar 17 '20 at 20:09
  • After some musings, it may not actually be Netbeans fault? I found that Git could not detect a case change in the filename, e.g., Renaming `Foo.txt` to `foo.txt` doesn't reflect in `git status`. Is there any setting in git that affects this? – IMB Mar 18 '20 at 18:32