Open
Description
I use two git repositories within project folder - one is .git
and second is .git_dev
. First is for project and second is to track my local config files. I used to work with second via alias git dev
which stands for git --git-dir=.git_dev
, but for now I explore ways to list changes within both repos in git sideview.
What I did:
- I create folder aside the main project folder(consider it
project
) and call itproject_dev
- Initialize new repo in new folder with
git init --separate-git-dir ../project/.git_dev
. It creates fileproject_dev/.git
with related line. - Then create new file within
project_dev
folder and open it in Code. Now I'm able to view changes for both repos, but one calledproject_dev
tracks theproject_dev
folder, not theproject
- So my next step is to add setting
worktree=/path/to/project
in.git_dev/cofig
. Now git sideview perfectly represents current changes forproject_dev
aside to mainproject
.
And here I run into two issues:
- if I try to click on changed file in
project_dev
section of sideview, an error occurs with message:Unable to open 'filename (Working Tree)': Unable to read file (Error: File not found (/path/to/project_dev/filename)).
like it doen't respect settingworktree
at all. - If I reload Code, even if I open file from
project_dev
folder, second repo is not shown. If I removeworktree
setting,project_dev
repo is shown again and I have to addworktree
setting again to get changes properly.
Example repo:
https://github.com/deitry/vscode-two-git-repos-issues
So, on the one hand I consider current behaviour as buggy. On the other hand, I make a request to add option to pass as many --git-dir
s as I want by making it a list:
"git.gitdirs: [ ".git", ".git_dev"]