git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git doesn't save capitalization change in file names.
@ 2016-01-12  2:06 Daniil S
  2016-01-12  3:46 ` Andrew Ardill
  0 siblings, 1 reply; 4+ messages in thread
From: Daniil S @ 2016-01-12  2:06 UTC (permalink / raw)
  To: git

So I've now encountered this with both GitHub and BitBucket, Windows and
Linux versions, so I'm fairly sure it's git's fault.

Example: if file named "Pathfinding.java" was renamed to "PathFinding.java"
and that change is then committed, filename won't change in repository.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git doesn't save capitalization change in file names.
  2016-01-12  2:06 Git doesn't save capitalization change in file names Daniil S
@ 2016-01-12  3:46 ` Andrew Ardill
  2016-01-12  8:02   ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Ardill @ 2016-01-12  3:46 UTC (permalink / raw)
  To: Daniil S; +Cc: git@vger.kernel.org

On 12 January 2016 at 13:06, Daniil S <ds98s3a@gmail.com> wrote:
>
> So I've now encountered this with both GitHub and BitBucket, Windows and
> Linux versions, so I'm fairly sure it's git's fault.
>
> Example: if file named "Pathfinding.java" was renamed to "PathFinding.java"
> and that change is then committed, filename won't change in repository.
>

This actually comes down to the file system you use, as git itself
does keep track of the capitalisation of file names; if the file
system is case insensitive (Mac OSX being the typical example) then
you can run into weird issues when files change case.

For example, the following two search results:

https://stackoverflow.com/questions/10523849/changing-capitalization-of-filenames-in-git

https://ocroquette.wordpress.com/2014/07/08/git-capitalization-of-file-names-and-name-conflicts/

Regards,

Andrew Ardill

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git doesn't save capitalization change in file names.
  2016-01-12  3:46 ` Andrew Ardill
@ 2016-01-12  8:02   ` Johannes Schindelin
  2016-01-12  9:58     ` Torsten Bögershausen
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2016-01-12  8:02 UTC (permalink / raw)
  To: Andrew Ardill; +Cc: Daniil S, git@vger.kernel.org

Hi,

On Tue, 12 Jan 2016, Andrew Ardill wrote:

> On 12 January 2016 at 13:06, Daniil S <ds98s3a@gmail.com> wrote:
> >
> > So I've now encountered this with both GitHub and BitBucket, Windows
> > and Linux versions, so I'm fairly sure it's git's fault.

I highly doubt that the Linux variety of Git displays this problem, unless
it is run on a case-insensitive file system.

> > Example: if file named "Pathfinding.java" was renamed to
> > "PathFinding.java" and that change is then committed, filename won't
> > change in repository.
> 
> This actually comes down to the file system you use, as git itself does
> keep track of the capitalisation of file names; if the file system is
> case insensitive (Mac OSX being the typical example) then you can run
> into weird issues when files change case.
> 
> For example, the following two search results:
> 
> https://stackoverflow.com/questions/10523849/changing-capitalization-of-filenames-in-git
> 
> https://ocroquette.wordpress.com/2014/07/08/git-capitalization-of-file-names-and-name-conflicts/

I'd like to offer the most common work-around:

git mv Pathfinding.java Pathfinding.java.rename
git mv Pathfinding.java.rename PathFinding.java

Ciao,
Johannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git doesn't save capitalization change in file names.
  2016-01-12  8:02   ` Johannes Schindelin
@ 2016-01-12  9:58     ` Torsten Bögershausen
  0 siblings, 0 replies; 4+ messages in thread
From: Torsten Bögershausen @ 2016-01-12  9:58 UTC (permalink / raw)
  To: Johannes Schindelin, Andrew Ardill; +Cc: Daniil S, git@vger.kernel.org

On 01/12/2016 09:02 AM, Johannes Schindelin wrote:
> Hi,
>
> On Tue, 12 Jan 2016, Andrew Ardill wrote:
>
>> On 12 January 2016 at 13:06, Daniil S <ds98s3a@gmail.com> wrote:
>>> So I've now encountered this with both GitHub and BitBucket, Windows
>>> and Linux versions, so I'm fairly sure it's git's fault.
> I highly doubt that the Linux variety of Git displays this problem, unless
> it is run on a case-insensitive file system.
>
>>> Example: if file named "Pathfinding.java" was renamed to
>>> "PathFinding.java" and that change is then committed, filename won't
>>> change in repository.
>> This actually comes down to the file system you use, as git itself does
>> keep track of the capitalisation of file names; if the file system is
>> case insensitive (Mac OSX being the typical example) then you can run
>> into weird issues when files change case.
>>
>> For example, the following two search results:
>>
>> https://stackoverflow.com/questions/10523849/changing-capitalization-of-filenames-in-git
>>
>> https://ocroquette.wordpress.com/2014/07/08/git-capitalization-of-file-names-and-name-conflicts/
> I'd like to offer the most common work-around:
>
> git mv Pathfinding.java Pathfinding.java.rename
> git mv Pathfinding.java.rename PathFinding.java
>

Side note: That should no longer be needed: new versions of Git can 
handle the rename these  days.

However, when A) does the rename, pushes it to a central repo,
B) pulls the changes, the file will stay un-renamed on the local disk.
You can delete all worktree files, and do a reset --hard, (at your own risk)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-12  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-12  2:06 Git doesn't save capitalization change in file names Daniil S
2016-01-12  3:46 ` Andrew Ardill
2016-01-12  8:02   ` Johannes Schindelin
2016-01-12  9:58     ` Torsten Bögershausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).