refresh all git repos
This commit is contained in:
parent
b89320d456
commit
3878013afc
1 changed files with 24 additions and 0 deletions
24
shell/reporefresh.sh
Executable file
24
shell/reporefresh.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# parent tree of repos
|
||||
WDIR="/home/user/gitrepos"
|
||||
|
||||
function reporefresh() {
|
||||
for repo in [a-z]*; do
|
||||
if [[ -d "${repo}/.git" && ! -L "${repo}" ]]; then
|
||||
pushd "$(pwd)" >/dev/null || return
|
||||
cd "${repo}" && echo "${repo}"
|
||||
git pull
|
||||
popd >/dev/null || return
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
cd "${WDIR}" || exit 1
|
||||
echo "Refreshing ${WDIR}"
|
||||
reporefresh
|
||||
echo
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue