0

For team process purpose I have a local GIT repo on Linux (centOS 7.5.1804, git version 1.8.3.1). On my side I managed it from Windows, with Sublime Merge or directly from gitbash (windows 10, git version 2.31.1.windows.1). I open directly the linux Repo (through a Network Map on windows) on Sublime Merge, or go to the linux directory on gitbash. If I modified few files (3 for example), when I use "Stage All" on Sublime Merge, or "git add -u" on gitbash, I have all my repo file staged (in my case 300). Sublime Merge display an additionnal warning for each files. Example for .gitattributes:

warning: LF will be replaced by CRLF in .gitattributes. The file will have its original line endings in your working directory

I have verified files, and all of them (modified or not) or with Linux endline (LR): Checked with VSCode, sublime text and notepad++ on Windows.

On gitbash, "git status" list all my 300 repo files as modified and not staged. I have no problem with my linux term on the same Repo.

What was wrong with my git on windows, and how to be able to use windows modern GIT GUI soft on my linux Repo ?

Thanks.

Information: on Windows "git config --list --show-origin --show-scope"

system  file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
system  file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl
system  file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain
system  file:C:/Program Files/Git/etc/gitconfig credential.helper=manager-core
system  file:C:/Program Files/Git/etc/gitconfig core.fscache=true
system  file:C:/Program Files/Git/etc/gitconfig core.symlinks=false
system  file:C:/Program Files/Git/etc/gitconfig pull.rebase=false
system  file:C:/Program Files/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true
system  file:C:/Program Files/Git/etc/gitconfig init.defaultbranch=master
global  file:C:/Users/john/.gitconfig           user.email=john.doe@discret.com
global  file:C:/Users/john/.gitconfig           user.name=john
global  file:C:/Users/john/.gitconfig           diff.tool=p4merge
global  file:C:/Users/john/.gitconfig           difftool.p4merge.path=C:\Users\john\Perforce\p4merge.exe
global  file:C:/Users/john/.gitconfig           merge.tool=p4merge
global  file:C:/Users/john/.gitconfig           mergetool.p4merge.path=C:\Users\john\Perforce\p4merge.exe
global  file:C:/Users/john/.gitconfig           mergetool.keepbackup=false
global  file:C:/Users/john/.gitconfig           core.autocrlf=false
local   file:.git/config                        core.repositoryformatversion=0
local   file:.git/config                        core.filemode=true
local   file:.git/config                        core.bare=false
local   file:.git/config                        core.logallrefupdates=true
local   file:.git/config                        core.autocrlf=false
local   file:.git/config                        remote.origin.url=https://server.com/git/project.git
local   file:.git/config                        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
local   file:.git/config                        branch.john_branch.remote=origin
local   file:.git/config                        branch.john_branch.merge=refs/heads/john_branch
  • There is something in your config that is making git change the EOL format of the files. Perhaps autoctrl? https://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git – eftshift0 May 07 '21 at 17:09
  • Set `core.autocrlf` to `true`, then run `git add -u` again (or possibly : `git reset HEAD` followed by `git add -u`) – LeGEC May 07 '21 at 23:26
  • I have already try everything arround autocrlf: remove-it at all level, change it value (many combinaison), and try all value (false, true, input). But it changes nothing to my issue :-(. Regarding the documentation, as my local repo is on linux (accessing it from windows with a map), I do not want that endline was converted in CRLF when I use GIT command on windows. So I pretty sure that the right value is core.autocrlf=false. – crashXpert May 14 '21 at 17:54

0 Answers0