gitrefresh

Easily export, reinitialize and update all git repositories in a file hierarchy
git clone git://git.defalsify.org/gitrefresh.git
Log | Files | Refs | LICENSE

commit 40a7d8838c44da5a3419fdd21b5c6e4818341b5f
parent 30e50ef82e51b931fbd4f161e06e8557e2729c5f
Author: lash <dev@holbrook.no>
Date:   Wed, 12 Jan 2022 22:06:54 +0000

Explicit branch name in pull

Diffstat:
Mgitrefresh.sh | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gitrefresh.sh b/gitrefresh.sh @@ -35,10 +35,6 @@ case "$cmd" in esac #echo using repo dir $(realpath $t) -repo_pull() { - repo_update $1 -} - repo_update() { >&2 echo updating `pwd` git remote update @@ -50,7 +46,8 @@ repo_update() { # fi git fetch if [ ! -z "$_pull" ]; then - git pull --ff-only + branch=`git branch --show-current` + git pull --ff-only origin $branch fi } @@ -82,6 +79,8 @@ scan() { repo_init "$g" "$p" elif [ "$cmd" == "update" ]; then repo_update $p + elif [ "$cmd" == "pull" ]; then + repo_update $p fi else for d in `find . -maxdepth 1 -not -path "\." -type d -printf "%f\n"`; do