So entfernen Sie alle .gitVerzeichnisse unter einem Ordner unter Linux.
Führen Sie diesen Befehl find aus, um alle .gitVerzeichnisse im aktuellen Ordner aufzulisten:
find . -type d -name ".git" \
&& find . -name ".gitignore" \
&& find . -name ".gitmodules"
Drucke:
./.git
./.gitmodules
./foobar/.git
./footbar2/.git
./footbar2/.gitignore
Es sollte nur 3 oder 4 .gitVerzeichnisse geben, da git nur einen .git-Ordner für jedes Projekt hat. Sie können rm -rf yourpathjedes der oben genannten von Hand.
Wenn Sie alle in einem Befehl entfernen und gefährlich leben möchten:
//Retrieve all the files named ".git" and pump them into 'rm -rf'
//WARNING if you don't understand why/how this command works, DO NOT run it!
( find . -type d -name ".git" \
&& find . -name ".gitignore" \
&& find . -name ".gitmodules" ) | xargs rm -rf
//WARNING, if you accidentally pipe a `.` or `/` or other wildcard
//into xargs rm -rf, then the next question you will have is: "why is
//the bash ls command not found? Requiring an OS reinstall.