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
+32
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user