Welcome to mirror list, hosted at ThFree Co, Russian Federation.

install_dev_githooks.sh - github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4e7e76d6c0490ffeeb6fa0d32024d887164505d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
echo Installing post-merge hook which recursively forces all
echo submodules to latest commit after every git pull
cat <<EOT >> .git/hooks/post-merge
#!/bin/sh
git submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git merge origin/\$branch;'
EOT
chmod +x .git/hooks/post-merge
echo Installing custom 'git pull-all' command for recursively
echo forcing all submodules to latest commit
git config alias.pull-all "submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git pull;'"