The main aim of what I'm trying to is to have two Git repositories in the same tree and for TortoiseGit to display differences of a modified file.
Here is the scenario. Two git repos: MainProj and SubProj and cloned as shown below:
MainProj SubProj
.git\ .git\
file0.txt file_s1.txt
dir1\ file_s2.txt
file1.txt
dir2\
file2.txt
I want to continue having the SubProj repository (.git) in its current place, but having its work files in the MainProj work tree, under dir1.
So the MainProj tree contains its own work files as well as those from SubProj with the latter continue having its repository in SubProj.
The disk will be as follows:
MainProj SubProj
.git\ .git\
file0.txt (files moved to MainProj/dir1)
dir1\
file1.txt
file_s1.txt (moved from SubProj)
file_s2.txt (moved from SubProj)
dir2\
file2.txt
To indicate this configuration to git, in a cmd shell.
>set "GIR_DIR=C:\path\to\SubProj"
>set "GIR_WORK_TREE=C:\path\to\MainProj\dir1"
Continuing in the same shell, I modify file_s1.txt
>echo xxx yyy zzz >> "C:\path\to\MainProj\dir1\file_s1.txt"
Continuing in the same shell, cd:
>cd C:\path\to\SubProj
In this directory, I run:
"D:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe" /command:commit
TortoiseGit correctly displays that file_s1.txt has been modified.
So far, so good.
However, double clicking on the modified file: I get:
How can this be overcome?
BTW When I tell it where to find the file, i.e. in C:\path\to\MainProj\dir1 TGit shows the differences correctly.
Further notes:
Using forward slashes for setting GIR_DIR and GIR_WORK_TREE the problem persists
Adding the parameter /path:C:/path/to/MainProj/dir1 the problem persists
Lastly, in directories:
>git status
works fine. TortoiseGit 2.11.0.0, git version 2.40.0.windows.1

