-1

I have few branches in my Git repo and people from my Team says that sometimes they download a clean copy or repo and checkout branch or pushing something then checkout branch then Git says that some files are modified but when we look into the changes nothing change.

What is going on here? I may be because Bitlocker on yours machines?

git diff on sample file

    @@ -5,12 +5,12 @@ webpackJsonp([0],{

 "use strict";
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CONFIG; });
-var CONFIG = {
-    baseUrls: {
-        vehicles: 'src/api/vehicles.json',
-        characters: 'src/api/characters.json'
-    }
-};
+var CONFIG = {
+    baseUrls: {
+        vehicles: 'src/api/vehicles.json',
+        characters: 'src/api/characters.json'
+    }
+};
 //# sourceMappingURL=config.js.map

 /***/ })

As you see nothing changed...

Nerf
  • 938
  • 1
  • 13
  • 30

1 Answers1

0

Line endings and white space. Git records all characters in a file, including invisible ones. What you're seeing there is likely line ending changes - maybe from \r\n to \n or vise-versa. Different operating systems use different line endings.

Fixes:

  1. configure editors to use the same ending
  2. configure git to convert line endings on commit https://help.github.com/articles/dealing-with-line-endings/
rubenwardy
  • 679
  • 5
  • 21