Update all GIT managed document folders
Submitted by hswong3i on Fri, 2012-05-25 09:38
My team use GIT to manage all project related documents, including quotation, sales order, invoice, SOW, module, theme, features, etc... So how to update all local GIT clone as update with other team members become a nightmare...
This script simply solve this problem:
cat > /usr/local/bin/git-pull-all.sh <<-EOF
#!/bin/bash
path=\${1}
if [ -z "\${path}" ]; then
path="."
fi
path=\`cd "\${path}"; pwd\`
find \${path} -type d -name '.git' -print |
while read git_path
do
echo "\${git_path}"
cd "\${git_path}"/../
git pull
git status
done
EOF
chmod a+x /usr/local/bin/git-pull-all.sh
Now run this script with:
cd ~/Documents git-pull-all.sh
Or even more simple:
git-pull-all.sh ~/Documents
Download Now!
wget http://edin.no-ip.com/files/git-pull-all_sh mv git-pull-all_sh /usr/local/bin/git-pull-all.sh chmod a+x /usr/local/bin/git-pull-all.sh
- hswong3i's blog
- 2068 reads


Add new comment