feat(git): add comprehensive git folder management commands and update documentation

This commit is contained in:
Janik von Rotz committed 2026-03-04 09:36:40 +01:00
1 parent 793b608732
commit 84f7ebfccb
15 files changed
+342 -10

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
add-git-folder() {
if [[ -z "$1" ]]; then
echo '$1/branch is empty.'
exit
fi
if [[ -z "$2" ]]; then
echo '$2/url is empty.'
exit
fi
if [[ -z "$3" ]]; then
echo '$3/path is empty.'
exit
fi
# Add to .gitmodules
git submodule add -f -b "$1" "$2" "$3"
# Ensure branch is Odoo version
git -C "$3" switch "$1"
# Save version
save-version
# Restore staged submodule files
git restore --staged .gitmodules "$3"
# Remove from working tree
# rm -rf .git/modules/"$2" || true
# git rm --cached "$2" || true
}