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 271668 - git system-wide property core.autocrlf is ignored (windows)
Summary: git system-wide property core.autocrlf is ignored (windows)
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: Ondrej Vrabec
Depends on:
Reported: 2017-10-18 15:47 UTC by nb_johan1
Modified: 2017-10-18 16:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description nb_johan1 2017-10-18 15:47:21 UTC
When core.autocrlf is located in system-wide configuration (and is unset on global and repo level) then netbeans will ignore it and commit updated files with CRLF. 

Such files are very difficult to manage in the repository, and unfortunately after committing, the problem cannot be solved just by one client commit. Each client should perform specific operations to their repo instance to fix it.

How to reproduce:

Make sure that on  windows machine the following does not print anything:
  git config --global core.autocrlf

But the following does:
  git config --system core.autocrlf

(the above is I believe the default setup on windows.)


- Create a new repo in linux, commit and push your changes. 
- clone the repo from windows with latest git client (git pull).
- Now edit the file

- scenario1: committing from CLI (use git-bash so that git grep works):
    git add
    git commit -m "file1"
    git grep -I --files-with-matches --perl-regexp '\r' HEAD
    # the last command will show nothing,which means that the file does not contain any '\r' characters
    # You can also push this change / pull it from linux client and repeat the command from a git client that has been compiled with "--with-libpcre" option.
    # Again you will see nothing.

- scenario2: committing from netbeans:
    # Edit the file again and commit it, this time from netbeans. Then again:
    git grep -I --files-with-matches --perl-regexp '\r' HEAD
    # Now you see in the list, which means that it has been committed with CRLF.
    # You can push your changes and perform the same action on linux or other windows machines. You will see being printed.
Comment 1 nb_johan1 2017-10-18 16:39:58 UTC
Note: The SAME ALSO happens even if --system is unset, in which case the effective configuration comes from : %HOME%/.gitconfig


    git config --global core.autocrlf
    git config --local core.autocrlf
    git config --system core.autocrlf

do not print anything, but 

   git config core.autocrlf