[odrbin] add git-wtinit

This commit is contained in:
odrling 2024-01-06 15:52:47 +01:00
parent fb5948cf79
commit 7cf76f6117
No known key found for this signature in database
GPG key ID: E24CA7508C27AF5B

9
.local/odrbin/git-wtinit Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
worktree="$1"
[ -z "$REPONAME" ] && REPONAME="$(basename "$worktree" .git)"
[ -z "$GITDIRS" ] && GITDIRS="$HOME/git/.gitdirs"
gitdir="$GITDIRS/$REPONAME"
git init --separate-git-dir "$gitdir" "$worktree"