Sitemap
전여철 (deadman55)

전여철 (deadman55)

medium test : git update shell

test story

Get 전여철 (deadman55)’s stories in your inbox

Join Medium for free to get updates from this writer.

git update shell

#!/bin/sh

function gitUpdate() {
targetDir=$1

echo "${targetDir}\n\n\n"

cd $targetDir

if [[ -e ".git" ]]; then
git fetch
git pull
else
echo "This is not git repo. pass by.."
fi

echo "\n\n"
cd ..
}

for file in *; do
if [[ -d "$file" && ! -L "$file" ]]; then
gitUpdate "$file";
fi;
done

--

--