Git discard changes in working directory submodule?

I agree with Richard that this could stem from a case sensitivity/insensitivity problem. I will address that issue with this answer Problem If a git commit contains two files whose names differ only in case, checking out that commit to a working directory in a case-insensitive filesystem causes problems. If the commit contains, for example myfile and myFILE git will create myfile and then when it goes to create/update myFILE the filesystem gives it a handle to myfile This becomes apparent if myfile and myFILE have different contents in the repository.

When checking out the files, the second one "wins" and the physical file contains the contents of the second file. When you do git status the two files in the index both get compared to the same file in the working directory, and for the losing file, the contents don't match Verifying the Problem You could checkout the repository on a case-sensitive system to analyze and resolve everything there. Alternatively, git does provide enough tools to deal with this on your current system The easy way to see if this is really the problem, is to make a trivial modification to one of files listed.

Then, running git status should show both variants of the filename, since the working dir version does not match either version in the index: $ echo >> public/javascripts/app/fckeditor/fckpackager. Xml $ git status Possible outcome: # On branch master # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: ... # modified: public/javascripts/app/fckeditor/fckpackager. Xml # modified: public/javascripts/app/fckeditor/FCKPACKAGER.

Xml Or, you can also use git ls-files to see what's in the index: $ git ls-files public/javascripts/app/fckeditor/fckpackager. Xml public/javascripts/app/fckeditor/fckpackager. Xml public/javascripts/app/fckeditor/FCKPACKAGER.

Xml If you want to see exactly what is in each file, you can use git checkout-index to pull a file out of the index and save it somewhere (using a prefix so contents are written to separate files): $ git checkout-index --prefix=v1/ public/javascripts/app/fckeditor/fckpackager. Xml $ git checkout-index --prefix=v2/ public/javascripts/app/fckeditor/FCKPACKAGER. Xml Resolution Once you have figured out which variant of each file you want to remove, you can remove it from the index using git rm --cached which respects the case of the paths given to it: $ git rm --cached public/javascripts/app/fckeditor/FCKPACKAGER.

Xml then commit, and if necessary do another git reset --hard However, your comment about logging in as a different user and getting different result indicates there might be a different problem. That being the case I would see if there are any differences in the user-specific . Gitconfig files.

I agree with Richard that this could stem from a case sensitivity/insensitivity problem. I will address that issue with this answer. Problem If a git commit contains two files whose names differ only in case, checking out that commit to a working directory in a case-insensitive filesystem causes problems.

If the commit contains, for example, myfile and myFILE, git will create myfile, and then when it goes to create/update myFILE, the filesystem gives it a handle to myfile. This becomes apparent if myfile and myFILE have different contents in the repository. When checking out the files, the second one "wins" and the physical file contains the contents of the second file.

When you do git status, the two files in the index both get compared to the same file in the working directory, and for the losing file, the contents don't match. Verifying the Problem You could checkout the repository on a case-sensitive system to analyze and resolve everything there. Alternatively, git does provide enough tools to deal with this on your current system.

The easy way to see if this is really the problem, is to make a trivial modification to one of files listed. Then, running git status should show both variants of the filename, since the working dir version does not match either version in the index: $ echo >> public/javascripts/app/fckeditor/fckpackager. Xml $ git status Possible outcome: # On branch master # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: ... # modified: public/javascripts/app/fckeditor/fckpackager.

Xml # modified: public/javascripts/app/fckeditor/FCKPACKAGER. Xml Or, you can also use git ls-files to see what's in the index: $ git ls-files public/javascripts/app/fckeditor/fckpackager. Xml public/javascripts/app/fckeditor/fckpackager.

Xml public/javascripts/app/fckeditor/FCKPACKAGER. Xml If you want to see exactly what is in each file, you can use git checkout-index to pull a file out of the index and save it somewhere (using a prefix so contents are written to separate files): $ git checkout-index --prefix=v1/ public/javascripts/app/fckeditor/fckpackager. Xml $ git checkout-index --prefix=v2/ public/javascripts/app/fckeditor/FCKPACKAGER.

Xml Resolution Once you have figured out which variant of each file you want to remove, you can remove it from the index using git rm --cached, which respects the case of the paths given to it: $ git rm --cached public/javascripts/app/fckeditor/FCKPACKAGER. Xml then commit, and if necessary do another git reset --hard However, your comment about logging in as a different user and getting different result indicates there might be a different problem. That being the case I would see if there are any differences in the user-specific .

Gitconfig files.

I seem to have fixed the issue, there was a problem with . Gitconfig removing the following has fixed the issue apply whitespace = fix – Karl Entwistle Nov 7 at 10:08.

You might be experiencing a case sensitivity problem. By default, Mac filesystems are case preserving but not case sensitive. Git itself is case sensitive.

If you don't have a case sensitive filesystem and there are two files checked in whose names differ only by case, git status will show one of the files as modified (assuming the contents of the two files is different). If you have two directories whose names differ only by case (e.g. , fckeditor and FCKeditor), then Git may show lots of modified files. Try creating a case-sensitive volume and run git clone in there.

For cleaning untracked file, you should use git clean -xdf instead of git clean -f only -d Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.

-x Don’t use the ignore rules. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.

I tried git clean -xdf however when I type git status the files are still there to be commited – Karl Entwistle Oct 25 at 15:54 git clean won't touch tracked files, so this is unrelated to the problem – Richard Hansen Nov 5 at 17:33.

Change to the submodule directory - it is its own repo - before you do operations on that submodule repo. You should then be able to clean and fix the sub-module repo 'in the usual ways'. The various sub-module articles (progit & git community book), while they do mention it, aren't as clear as needed to pick that point.

The OP deleted and re-cloned the entire project and the problem was still there, so something else is going on -- the "usual ways" won't work. – Richard Hansen Nov 5 at 17:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions