I have a master
and a setup
branch in my repo. I'm keeping the setup
branch checked out as a worktree inside the main repo folder via
git worktree add ./local/setup
echo '/local' > .gitignore
So the main repo folder is on master
, and the local/setup
folder is on setup
. Everything is fine and dandy, I can work on my setup
files without having to switch branches, I can commit from within local/setup
etc.
But if I try to move the entire repo, or access it from a different Linux boot (/home/myrepo
becomes /mnt/ubu/home/myrepo
), things break. The problem seems to be that git
's worktree functionality records absolute paths, in
myrepo/.git/worktrees/setup/gitdir
myrepo/local/setup/.git
Can I convert these to relative paths to make the repo + embedded worktree relocatable? I'm not sure what the paths in those files should be relative to, but I can experiment. Is this setup dangerous?
chroot
/arch-chroot
etc. But.. why not? – Grundyismexpr
instead of thestrpos
hack (some folks hate it, but it's POSIX & will never go away); 2) no need forsubstr
, you're not using its "enhancements" 3)cat <<'EOF'
for help messages instead of 1000 echo's 4) we need mkabs to revert mkrel beforeworktree remove
, otherwise git refuses – Grundyism