This is a huge pain in the bum. I\'ve got this a few times before and I don\'t understand why. 5 mins ago the repo was fine and working, I move some files around (which is a
Oh dear I'm such a fail. It looks like the problem stems from Flash Builder copying over other .git repos into sub folders. The answer is to remove all .git folders that aren't the repo's one.
Usually, git creates a hidden directory in project's root directory (.git/)
When you're working on a CMS, its possible you install modules/plugins carrying .git/ directory with git's metadata for the specific module/plugin
If you do not want to use git's submodules feature, quickest solution delete all .git directories except root git metadata directory. If you do so, git will not consider those modules as project submodules.
cd /path/to/your/project/code
find ./ | grep ".git/index"
Once located delete ".git" all directories except the root one, but if you deleted it initialize your repo again
I ran into this error because of a corrupted/not properly initialized submodule (with its own .git subfolder). I temporarily deleted the submodules folder and used git init
in the main project's root. Fixed the problem for me.
I don't have any .git folders in my repo, but anytime I copy my new files into my folder to update my app, I am still getting index corrupt porcelain failed errors. I don't understand how updating files would corrupt this or how to fix it. Anyone have further insight on this?
git remote -v
#now run the same commands
git remote add origin remote-repository-url.git
git push origin master
// It's work very well
.git
is a file in submodules and points to a directory located in your root .git
directory.
In my case, I was mounting a git directory in docker and checking status there. The .git file of this submodule contained an absolute path which was invalid in docker. I edited this .git
file to change the gitdir path to a relative path.
Git version: 2.7.4