Due to unnecessary long names for some of my directories I went ahead to rename them. This worked fine for two of them but not for a third due to...
git mv DA305A-ProgrammeringMedCSharpOchXNA/ programmeringMedCSharpOchXNA
fatal: source directory is empty, source=DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar, destination=programmeringMedCSharpOchXNA/Projekt/UniWar
It is very true that this directory is empty (no .git directory either), however, i'm not sure why it matters..
I might have once added a subprject here, but i'm not 100% sure, it might have just been another repository inside another (not as a subproject). I'm fairly new to git so it's very possible i did something strangely.
This is what i've done in order to find out more... it hasn't led me to a solution
git submodule status
No submodule mapping found in .gitmodules for path 'DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar'
cat .gitmodules
cat: .gitmodules: No such file or directory
grep -r UniWar .git/**
Binary file .git/inde开发者_如何学Pythonx matches
Opening .git/index in vim, it looks like a normal text file and there is no 'UniWar' found anywhere inside of it. Opening it in notepad shows a match amongst the bogus characters.
Simply trying to git remove the directory won't work either...
git rm -r DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar
rm 'DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar'
Unlink of file 'DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar' failed. Should I try again? (y/n)? y
Unlink of file 'DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar' failed. Should I try again? (y/n)? n
fatal: git rm: 'DA305A-ProgrammeringMedCSharpOchXNA/Projekt/UniWar': Permission denied
No clue why i get permission denied, i couldn't find any file handles matching 'UniWar'.
My issue was resolved by first doing a normal
rm -r DA305-ProgrammeringMedCSharpOchXNA/Projekt
followed by
git rm -r DA305-ProgrammeringMedCSharpOchXNA/Projekt
(this time without permission denied error). I was then allowed to move the directory.
精彩评论