2 files, same name, one uppercase, one lowercase

343 views
Skip to first unread message

rupert THURNER

unread,
Oct 18, 2015, 8:13:17 AM10/18/15
to git-for-windows

hi,


we have a linux-windows mixed environment and somebody had the glorious idea to commit a README.txt alongside a preexisting readme.txt file. i am used git for windows 2.5.3. should this work? i usually do 

   git fetch --all -p

   git rebase

 

after git checked out a commit with the 2 files, it kept saying 

        modified:   README.txt

 

on the windows filesystem only readme.txt was visible. when i remove readme.txt git said:

        deleted:    README.txt

        deleted:    readme.txt


i deleted the file on linux, pushed it and did a reset --hard to a commit with only one file to resolve it for now. but am am wondering if there would be a possibility to handle the case on windows as well?

 

best,

rupert


rupert THURNER

unread,
Oct 18, 2015, 8:13:17 AM10/18/15
to git-for-windows
hi,

we have a linux-windows mixed environment and somebody had the glorious idea to commit a README.txt alongside a preexisting readme.txt file. should this work? i usually do 
   git fetch --all -p
   git rebase

after git checked out a commit with the 2 files, it kept saying 
        modified:   README.txt

on the windows filesystem only readme.txt was visible. when i remove readme.txt git said:
        deleted:    README.txt
        deleted:    readme.txt

best,
rupert

Konstantin Khomoutov

unread,
Oct 18, 2015, 10:49:11 AM10/18/15
to rupert THURNER, git-for-windows
In theory, yes, but you'd need to reach for the plumbing tools to only
update the index without touching the file system.

The tools of interest, IMO, are:

* `git ls-tree` -- to see what's contained in a particular commit,
say, HEAD.

* `git show` -- to get the contents of the specified file as recorded
in a specified commit, say,

git show HEAD:path/to/some/file > foo.txt

* `git rm --cached` -- to remove entries from the index only.

* `git hash-object -w path/to/a/file` -- to create a blob in the Git
object storage for the specified file and print the SHA-1 hash of
that blob (its name) to the standard output.

* `git update-index --cacheinfo` to directly create an entry in the
index referring to the specified object (blob in your case).
Reply all
Reply to author
Forward
0 new messages