Skip to content

Commit 76b3969

Browse files
committed
update git helpers
1 parent 320179f commit 76b3969

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

.claude/worktrees/busy-hugle

Lines changed: 0 additions & 1 deletion
This file was deleted.

.claude/worktrees/happy-austin

Lines changed: 0 additions & 1 deletion
This file was deleted.

programs/git.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ function git_clone_to() {
44
local basedir=$2
55
local email=$3
66
local dir=$basedir/${1##*/}
7-
if [[ ! -d $dir ]]; then
7+
if [[ -d $dir ]]; then
8+
(
9+
cd "$dirb"
10+
log_msg "git pull at $dir"
11+
git pull -q
12+
)
13+
else
814
if [[ ! -d $basedir ]]; then mkdir -p $basedir; fi
915
log_msg "git clone $url at $dir"
1016
git clone $url $dir
17+
1118
fi
1219
if [[ -n $email ]]; then
1320
(

programs/git.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ function git_clone_to() {
88
log_error "Usage: git_clone_to <url> <basedir> [<email>]. Use <email> to differ from ~/.gitconfig email."; return
99
}
1010
$dir = Join-Path $basedir (Split-Path $url -Leaf)
11-
if (-not (Test-Path $dir)) {
11+
if (Test-Path $dir) {
12+
Push-Location $dir
13+
log_msg "git pull at $dir"
14+
git pull -q
15+
Pop-Location
16+
} else {
1217
if (-not (Test-Path $basedir)) {
1318
New-Item -Path $basedir -ItemType Directory -Force
1419
}

0 commit comments

Comments
 (0)