# "Changes not staged for commit" after cloning a repo on macOS

5 messages from 2018-08-15 to 2018-08-16. Participants: Hadi Safari, Bryan Turner, Torsten Bögershausen.
Thread: https://gitlist.dev/t/49137

## Hadi Safari, 2018-08-15 19:55

Subject: "Changes not staged for commit" after cloning a repo on macOS
Message-ID: <6022fbe8-0e07-f561-5e66-eeb4bc92704d@hadisafari.ir>
URL: https://gitlist.dev/e/6022fbe8-0e07-f561-5e66-eeb4bc92704d%40hadisafari.ir

```
Hi everyone!

I encountered a strange situation on OS X recently. I cloned a 
repository (https://github.com/kevinxucs/Sublime-Gitignore.git), went to 
folder, and saw "Changes not staged for commit" message for four 
specific files. It happened every time I repeated the procedure. I even 
was able to commit those to the repo.
At first I thought there's something wrong with repo, but I cloned it on 
Ubuntu 16.04 and everything was OK; no "Changes not staged for commit" 
message.

Does anyone have any idea?

Thank you.

Log:

ˋˋˋ
$ git clone https://github.com/kevinxucs/Sublime-Gitignore.git
Cloning into 'Sublime-Gitignore'...
remote: Counting objects: 515, done.
remote: Total 515 (delta 0), reused 0 (delta 0), pack-reused 515
Receiving objects: 100% (515/515), 102.14 KiB | 48.00 KiB/s, done.
Resolving deltas: 100% (143/143), done.
$ cd Sublime-Gitignore/
$ 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:   boilerplates/Nanoc.gitignore
     modified:   boilerplates/OpenCart.gitignore
     modified:   boilerplates/SASS.gitignore
     modified:   boilerplates/WordPress.gitignore

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

The rest of the log is available at 
https://github.com/kevinxucs/Sublime-Gitignore/issues/6. (I don't want 
this email to become too long.)

-- 
Hadi Safari
http://hadisafari.ir/

```

## Bryan Turner, 2018-08-15 21:06

Subject: Re: "Changes not staged for commit" after cloning a repo on macOS
Message-ID: <CAGyf7-EKCznDksZ6jovmtoA94Tj2V95zkMkS3PJrYfEYsO9U3w@mail.gmail.com>
URL: https://gitlist.dev/e/CAGyf7-EKCznDksZ6jovmtoA94Tj2V95zkMkS3PJrYfEYsO9U3w%40mail.gmail.com
In-Reply-To: <6022fbe8-0e07-f561-5e66-eeb4bc92704d@hadisafari.ir>

```
On Wed, Aug 15, 2018 at 1:50 PM Hadi Safari <hadi@hadisafari.ir> wrote:
>
> Hi everyone!
>
> I encountered a strange situation on OS X recently. I cloned a
> repository (https://github.com/kevinxucs/Sublime-Gitignore.git), went to
> folder, and saw "Changes not staged for commit" message for four
> specific files. It happened every time I repeated the procedure. I even
> was able to commit those to the repo.
> At first I thought there's something wrong with repo, but I cloned it on
> Ubuntu 16.04 and everything was OK; no "Changes not staged for commit"
> message.
>
> Does anyone have any idea?
>
>      modified:   boilerplates/Nanoc.gitignore
>      modified:   boilerplates/OpenCart.gitignore
>      modified:   boilerplates/SASS.gitignore
>      modified:   boilerplates/WordPress.gitignore

Taking a look at the repository's file list on GitHub[1], it shows
that this is because HFS and APFS by default are case-insensitive.

The file listing shows that there is a "nanoc.gitignore" and
"Nanoc.gitignore". On APFS and HFS, those are the same file. As a
result, one overwrites the other. This is discussed pretty regularly
on the list[2], so you can find more details there.

[1]: https://github.com/kevinxucs/Sublime-Gitignore/tree/master/boilerplates
[2]: https://public-inbox.org/git/24A09B73-B4D4-4C22-BC1B-41B22CB59FE6@gmail.com/
is a fairly recent (fairly long) thread about this behavior.

Hope this helps!
Bryan

```

## Hadi Safari, 2018-08-16 03:04

Subject: Re: "Changes not staged for commit" after cloning a repo on macOS
Message-ID: <3e0d7bd4-003e-60ea-ce1a-323ac49b4f71@hadisafari.ir>
URL: https://gitlist.dev/e/3e0d7bd4-003e-60ea-ce1a-323ac49b4f71%40hadisafari.ir
In-Reply-To: <CAGyf7-EKCznDksZ6jovmtoA94Tj2V95zkMkS3PJrYfEYsO9U3w@mail.gmail.com>

```
I checked line-ending but didn't think to file names.

Thank you so much.

On 25/5/1397 AP 1:36 AM, Bryan Turner wrote:
> Taking a look at the repository's file list on GitHub[1], it shows
> that this is because HFS and APFS by default are case-insensitive.
> 
> The file listing shows that there is a "nanoc.gitignore" and
> "Nanoc.gitignore". On APFS and HFS, those are the same file. As a
> result, one overwrites the other. This is discussed pretty regularly
> on the list[2], so you can find more details there.
> 
> [1]: https://github.com/kevinxucs/Sublime-Gitignore/tree/master/boilerplates
> [2]: https://public-inbox.org/git/24A09B73-B4D4-4C22-BC1B-41B22CB59FE6@gmail.com/
> is a fairly recent (fairly long) thread about this behavior.
> 

-- 
Hadi Safari

```

## Torsten Bögershausen, 2018-08-16 06:23

Subject: Re: "Changes not staged for commit" after cloning a repo on macOS
Message-ID: <20180816062317.GA5080@tor.lan>
URL: https://gitlist.dev/e/20180816062317.GA5080%40tor.lan
In-Reply-To: <6022fbe8-0e07-f561-5e66-eeb4bc92704d@hadisafari.ir>

```
On Thu, Aug 16, 2018 at 12:25:24AM +0430, Hadi Safari wrote:
> Hi everyone!
> 
> I encountered a strange situation on OS X recently. I cloned a repository
> (https://github.com/kevinxucs/Sublime-Gitignore.git), went to folder, and
> saw "Changes not staged for commit" message for four specific files. It
> happened every time I repeated the procedure. I even was able to commit
> those to the repo.
> At first I thought there's something wrong with repo, but I cloned it on
> Ubuntu 16.04 and everything was OK; no "Changes not staged for commit"
> message.
> 
> Does anyone have any idea?
> 
> Thank you.
> 
> Log:
> 
> ˋˋˋ
> $ git clone https://github.com/kevinxucs/Sublime-Gitignore.git
> Cloning into 'Sublime-Gitignore'...
> remote: Counting objects: 515, done.
> remote: Total 515 (delta 0), reused 0 (delta 0), pack-reused 515
> Receiving objects: 100% (515/515), 102.14 KiB | 48.00 KiB/s, done.
> Resolving deltas: 100% (143/143), done.
> $ cd Sublime-Gitignore/
> $ 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:   boilerplates/Nanoc.gitignore
>     modified:   boilerplates/OpenCart.gitignore
>     modified:   boilerplates/SASS.gitignore
>     modified:   boilerplates/WordPress.gitignore
> 
> no changes added to commit (use "git add" and/or "git commit -a")
> ˋˋˋ
> 
> The rest of the log is available at
> https://github.com/kevinxucs/Sublime-Gitignore/issues/6. (I don't want this
> email to become too long.)
> 
> -- 
> Hadi Safari
> http://hadisafari.ir/


This repo seams not ment to be cloned onto a file system, which is case-insensitive.
For example, (see below), this 2 files a different in the repo, but the file system
can not have 'WordPress' and 'Wordpres's as different files or directories at the same
time.
This affects typically Mac OS and Windows users.

There is actually some work going on right now to inform the user about this problem.
(Thanks Duy !)
If I clone it with a patched Git, I get the following:


git clone https://github.com/kevinxucs/Sublime-Gitignore.git
Cloning into 'Sublime-Gitignore'...
remote: Counting objects: 515, done.
remote: Total 515 (delta 0), reused 0 (delta 0), pack-reused 515
Receiving objects: 100% (515/515), 102.16 KiB | 35.00 KiB/s, done.
Resolving deltas: 100% (143/143), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'boilerplates/Gcov.gitignore'
  'boilerplates/Nanoc.gitignore'
  'boilerplates/OpenCart.gitignore'
  'boilerplates/SASS.gitignore'
  'boilerplates/Sass.gitignore'
  'boilerplates/Stella.gitignore'
  'boilerplates/WordPress.gitignore'
  'boilerplates/Wordpress.gitignore'
  'boilerplates/gcov.gitignore'
  'boilerplates/nanoc.gitignore'
  'boilerplates/opencart.gitignore'
  'boilerplates/stella.gitignore'

Would this text help you ?

I am asking because the development is still ongoing, so things can be improved.

```

## Hadi Safari, 2018-08-16 07:28

Subject: Re: "Changes not staged for commit" after cloning a repo on macOS
Message-ID: <d132cb0e-97f2-708c-83b2-124ee4569e17@hadisafari.ir>
URL: https://gitlist.dev/e/d132cb0e-97f2-708c-83b2-124ee4569e17%40hadisafari.ir
In-Reply-To: <20180816062317.GA5080@tor.lan>

```
On 25/5/1397 AP 10:53 AM, Torsten Bögershausen wrote:
> This repo seams not ment to be cloned onto a file system, which is case-insensitive.
> For example, (see below), this 2 files a different in the repo, but the file system
> can not have 'WordPress' and 'Wordpres's as different files or directories at the same
> time.
> This affects typically Mac OS and Windows users.
> 
> There is actually some work going on right now to inform the user about this problem.
> (Thanks Duy !)
> If I clone it with a patched Git, I get the following:
> 
> 
> git clone https://github.com/kevinxucs/Sublime-Gitignore.git
> Cloning into 'Sublime-Gitignore'...
> remote: Counting objects: 515, done.
> remote: Total 515 (delta 0), reused 0 (delta 0), pack-reused 515
> Receiving objects: 100% (515/515), 102.16 KiB | 35.00 KiB/s, done.
> Resolving deltas: 100% (143/143), done.
> warning: the following paths have collided (e.g. case-sensitive paths
> on a case-insensitive filesystem) and only one from the same
> colliding group is in the working tree:
> 
>    'boilerplates/Gcov.gitignore'
>    'boilerplates/Nanoc.gitignore'
>    'boilerplates/OpenCart.gitignore'
>    'boilerplates/SASS.gitignore'
>    'boilerplates/Sass.gitignore'
>    'boilerplates/Stella.gitignore'
>    'boilerplates/WordPress.gitignore'
>    'boilerplates/Wordpress.gitignore'
>    'boilerplates/gcov.gitignore'
>    'boilerplates/nanoc.gitignore'
>    'boilerplates/opencart.gitignore'
>    'boilerplates/stella.gitignore'
> 
> Would this text help you ?
> 
> I am asking because the development is still ongoing, so things can be improved.
> 

Yes, thank you. It's clear and helpful. I got what is happening.

-- 
Hadi Safari
http://hadisafari.ir/

```
