0

I'm doing the same git clone on Windows 7 and on Ubuntu 17.04 (in a VM with VirtualBox) but I don't get the same result with a git status.

I do git status right after the git clone is over.

On Windows :

    $ 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 checkout -- <file>..." to discard changes in working directory)

            modified:   server/node_modules/jQuery/README.md
            modified:   server/node_modules/jQuery/package.json

    no changes added to commit (use "git add" and/or "git commit -a")

On Ubuntu :

    $ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.

    Nothing to commit, working tree clean

Now, if I open server/node_modules/jQuery/package.json, it is indeed different.

On Windows : __dependencies and __devDependencies are missing

    {
      "_args": [
        [
          {
            "raw": "jquery",
            "scope": null,
            "escapedName": "jquery",
            "name": "jquery",
            "rawSpec": "",
            "spec": "latest",
            "type": "tag"
          },
          "/home/osboxes/Documents/performance"
        ]
      ],
      "_from": "jquery@latest",
      (...)

On Ubuntu : __dependencies and __devDependencies are visible

        {
        "__dependencies": {
          "jsdom": "~0.2.14",
          "htmlparser": "1.7.6",
          "xmlhttprequest": "~1.4.2",
          "location": "0.0.1",
          "navigator": "~1.0.1"
        },
        "__devDependencies": {
          "grunt": "~0.3.8",
          "nodeunit": "~0.7.4"
        },
        "_args": [
          [
            {
              "raw": "jQuery",
              "scope": null,
              "escapedName": "jQuery",
              "name": "jQuery",
              "rawSpec": "",
              "spec": "latest",
              "type": "tag"
            },
            "/home/osboxes/Documents/performance"
          ]
        ],
        "_from": "jQuery@latest",
        (...)

If I check on the repo online, it matches the Ubuntu version.

Any idea on why complete part of the files are missing in Windows and not in Ubuntu ?

I've seen many topisc about ending line problems between Windows and Ubuntu files but it seems to be another problem here.

Thanks.

pwet84
  • 1
  • Run the Linux version through "od" and inspect that the file looks like at the character level. I wonder if there are some strange characters causing the other git to barf? Are these pure ASCII files, or do they contain multi-byte chars? –  Nov 15 '17 at 16:21
  • @jdv : not quite sure about what you want me to do here. Run ````od server/node_modules/jQuery/package.json```` ? – pwet84 Nov 17 '17 at 07:51
  • `od` is a great tool for inspecting files at a deep level. Let's make sure that the file as it is created on Linux doesn't contain surprising characters. Surprising characters can cause all sorts of interesting cross-platform issues. We want to determine if the problem stems from an issue in the _content_ of the revisions git is attempting to write out, or if the problem is higher up. Read the `od` man page, but I'd start with `od -c` and work in from there. Satisfy yourself that these are "just" regular text files, at least when created by git and work back from there. –  Nov 17 '17 at 14:15
  • Wait. Git is telling you changes have been made to those files. What happens if you simply move those modified files to a safe place and force a clean checkout at the same revision? –  Nov 17 '17 at 14:20

0 Answers0