Closed chase closed 5 months ago
For git worktrees, .git is actually a file, not a directory.
.git
I modified create_conflict.sh for testing it with worktrees:
create_conflict.sh
#!/bin/bash [ -d ./../conflict-test/ ] && rm -rf ./conflict-test/ mkdir conflict-test cd conflict-test || exit git init touch conflicted.lua git add conflicted.lua echo "local value = 1 + 1" > conflicted.lua git commit -am 'initial' git checkout -b new_branch echo "local value = 1 - 1" > conflicted.lua git commit -am 'first commit on new_branch' git checkout main cat > conflicted.lua<< EOF local value = 5 + 7 print(value) print(string.format("value is %d", value)) EOF git commit -am 'second commit on main' git switch new_branch git worktree add ../worktree-test main (cd ../worktree-test && git merge new_branch)
Thanks, this fixes the issue for me too!
Awesome work
For git worktrees,
.git
is actually a file, not a directory.I modified
create_conflict.sh
for testing it with worktrees: