gitrefresh

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

commit b53a92370b65b6b90646bbc720f6c04b0a1b0ab7
parent c3debc2f174a9354e3f4fd8346033f0aaa8ab6c2
Author: lash <dev@holbrook.no>
Date:   Wed, 12 Jan 2022 14:16:22 +0000

Add pull option for gitrefresh

Diffstat:
Mgitrefresh.sh | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/gitrefresh.sh b/gitrefresh.sh @@ -16,6 +16,7 @@ if [ -z "$cmd" ]; then exit 1 fi +_pull= case "$cmd" in init) t=`mktemp -d` @@ -23,6 +24,10 @@ case "$cmd" in update) pushd $2 ;; + pull) + pushd $2 + _pull=1 + ;; *) >&2 echo invalid command: "$cmd" exit 1 @@ -40,6 +45,9 @@ repo_update() { # sed -e "s/^.*:\(.*\)$/\1/g" # fi git fetch + if [ ! -z "$_pull" ]; then + git pull --ff-only + fi } repo_init() {