158 questions
4
votes
1
answer
106
views
get path to .git/ directory, including from a worktree
My intention is to locate the "root" .git/ directory of my current repo, meaning:
if I currently am in a worktree, I want the .git/ directory of the source repo, not the one dedicated to my ...
0
votes
2
answers
115
views
Python exec and Git's worktree lifecycle
I'm encountering a peculiar issue when using Python's exec function within scripts that are run across different Git worktrees. Specifically, I've observed that the behavior of exec (and by extension, ...
2
votes
1
answer
73
views
How do I re-use existing submodule checkouts when creating a worktree in Git?
I have a project where I have checked out the main branch, which has 2 submodules: vendor/foo and vendor/bar. If I create a worktree for a feature branch with git worktree add ../feature feature, this ...
0
votes
1
answer
143
views
Debugging Flask in Cursor Git Worktree Environment with Poetry Not Working
Interesting pre data:
I had no problem debugging in cursor before I created a git worktree of my repo
Issue Details:
After creating a git worktree I now how a separate .venv in both worktrees
I ...
1
vote
0
answers
59
views
Convert each submodule directory in a worktree into a proper linked worktree of a central clone
I’m trying to avoid having each worktree of my super-repo clone its submodules over and over. Instead I’d like each submodule directory in every worktree to be just another linked worktree of a single ...
0
votes
0
answers
78
views
LFS files marked as modified on a worktree to bare repo
I have a bare repo and a worktree associated with it. Ran git lfs install, setup some lfs filters then ran git lfs pull and the lfs files appear as modified. From what I understood the step that makes ...
0
votes
0
answers
49
views
Is there a git native check whether a specific branch is checked out in any worktree?
If I run git branch, I will see output that looks like this:
+ branch1
* branch2
branch3
+ branch4
branch5
The output tells me visually which branches are checked out, but I would need to do ...
0
votes
1
answer
109
views
git --work-tree flag is accepted, but git worktree add fails
Am implementing a git-based dotfile version control system.
An alias setting --work-tree=$HOME does not encounter any problems.
alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --...
0
votes
2
answers
2k
views
Using Git hooks with worktree
I've been using git worktree for a long time, but I just realized an issue with hooks.
It always seems to run hooks from the main worktree and never ones specific to the current work tree. Is there a ...
0
votes
1
answer
154
views
Getting ` warning: refname 'HEAD' is ambiguous.` after `git clone --bare` and `git worktree add`
I'm lookng into git worktrees b/c I want to work on multiple branches at once. Did the following setup
# Created new E:\ partion
cd /d E:
mkdir repos
cd repos
git clone --bare <repository-url>/...
4
votes
1
answer
1k
views
How to move changes to new worktree?
I have uncommitted and staged changes in my main branch. I want to put those existing changes in a different worktree, so that my main branch/folder stays clean. How do I do that?
I've tried ...
1
vote
1
answer
229
views
How to find the worktree path of a branch
Let's say I'm inside a Git repo with worktrees. Given a branch name, how can I find out if this branch is checked out in a worktree, and if so, the path to this worktree?
P.S. this is for a script, I ...
1
vote
1
answer
137
views
How can I find the windows drive letter substitutions used for all my git worktrees with a single command?
I have a batch file I use to maintain drive letters for local paths.
As these are volatile I have them saved to a txt file that gets read when I boot up my machine. This lets me have local "...
1
vote
0
answers
102
views
Git use a worktree as a submodule
I have a git repository that I would like to reuse in another project as a library.
So I have this kind of library (Lib A) that has quite a lot of branches for different configurations and I want to ...
1
vote
1
answer
558
views
Meaning of '+' symbol at the beginning of branch name in `git branch` output
I'm using git-subrepo. I've created a git subrepo branch and when I run git branch it outputs something like this:
$ git branch
* master
+ subrepo/CurriculumVitae
What's the meaning of that + symbol?
...