feat(git): add comprehensive git folder management commands and update documentation
This commit is contained in:
15 files changed
+342
-10
No files matched your search
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
remove-git-folder() {
|
||||
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
|
||||
local git_folders=$(ls-git-folder "$1")
|
||||
|
||||
echo "Delete: $git_folders"
|
||||
read -p "Are you sure to delete these git folder(s)? (yes/N): " confirm
|
||||
if [[ "${confirm,,}" != "yes" ]]; then
|
||||
echo 'Aborted.'
|
||||
return 1
|
||||
fi
|
||||
for git_folder in $git_folders; do
|
||||
echo "Remove $git_folder from .gitmodules file."
|
||||
git config --file .gitmodules --remove-section "submodule.$git_folder"
|
||||
|
||||
echo "Delete git folder $git_folder."
|
||||
rm -rf "$git_folder"
|
||||
done
|
||||
|
||||
save-version
|
||||
}
|
||||
Reference in new issue
Block a user