Created
January 26, 2021 16:46
-
-
Save twfahey1/cf3a0ca4d2a8d03b5de3132ce2c54ab9 to your computer and use it in GitHub Desktop.
Sanitize all git folders in subdirectories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Temporarily move current .git to not purge it. | |
mv .git .gitbackup | |
mv .gitignore .gitignorebackup | |
# Purge all gits | |
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} + | |
# Put back original git | |
mv .gitbackup .git | |
mv .gitignorebackup .gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful to ensure composer downloaded dependencies don't have submodule git folders, which will cause issues with providers like Pantheon