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
|
||||
|
||||
pull-git-folder() {
|
||||
if [[ -z "$1" ]]; then
|
||||
echo '$1/branch is empty.'
|
||||
exit
|
||||
fi
|
||||
if [[ -z "$2" ]]; then
|
||||
echo '$2/path is empty.'
|
||||
exit
|
||||
fi
|
||||
|
||||
local git_folders=$(ls-git-folder "$2")
|
||||
for git_folder in $git_folders; do
|
||||
echo "Pull git folder $git_folder."
|
||||
git -C "$git_folder" stash
|
||||
local update=$(git config submodule."$git_folder".update)
|
||||
if [[ -z "$update" ]]; then
|
||||
git -C "$git_folder" pull origin "$1"
|
||||
fi;
|
||||
done
|
||||
}
|
||||
Reference in new issue
Block a user