Symptôme :
germain@germain-xps MINGW64 ~/Documents/Sites/site.preprod (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: www/markup-anim/article.html
modified: www/markup-anim/board.html
modified: www/markup-anim/contact.html
modified: www/markup-anim/css/style.css
modified: www/markup-anim/inc/hub-markers.json
modified: www/markup-anim/inc/hub-popup-structure.html
modified: www/markup-anim/inc/hub-section-01.html
modified: www/markup-anim/inc/hub-section-02.html
modified: www/markup-anim/inc/hub-section-03.html
modified: www/markup-anim/inc/hub-section-04.html
modified: www/markup-anim/inc/hub-section-05.html
modified: www/markup-anim/inc/index-markers.json
modified: www/markup-anim/inc/popup-section-01.html
modified: www/markup-anim/index.html
modified: www/markup-anim/js/app.js
modified: www/markup-anim/knowledge-network.html
modified: www/markup-anim/news.html
modified: www/markup-anim/pdf-templates.html
modified: www/markup-anim/regional-hubs.html
Il semble donc que tous les fichiers de la liste soient modifiés.
Pourtant, quand on cherche les différences, point de modification :
germain@germain-xps MINGW64 ~/Documents/Sites/site.preprod (master)
$ git diff www/markup-anim/article.html
On peut déjà commencer par vérifier qu’on ignore les différences de sauts de lignes, et de permissions sur les fichiers :
germain@germain-xps MINGW64 ~/Documents/Sites/site.preprod (master)
$ git config --global core.autocrlf true
$ git config --global core.fileMode false
Si ça ne résout pas le problème instantanément, il est nécessaire de rafraîchir l’index :
git add --renormalize .
À quoi ça sert ?
--renormalize
Apply the "clean" process freshly to all tracked files to
forcibly add them again to the index. This is useful after
changing core.autocrlf configuration or the text attribute in
order to correct files added with wrong CRLF/LF line endings.
This option implies -u.
À l’issue :
germain@germain-xps MINGW64 ~/Documents/Sites/site.preprod (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: www/markup-anim/css/style.css
modified: www/markup-anim/inc/hub-markers.json
modified: www/markup-anim/inc/hub-section-01.html
modified: www/markup-anim/inc/hub-section-02.html
modified: www/markup-anim/inc/hub-section-03.html
modified: www/markup-anim/inc/hub-section-04.html
modified: www/markup-anim/inc/hub-section-05.html
modified: www/markup-anim/js/app.js
modified: www/markup-anim/regional-hubs.html
Seuls les fichiers réellement modifiés apparaissent maintenant à l’index.