I'm getting this error between two W10 systems running a VPN and RDP.
My local system "My
" has an area c:\cap2office
that is a Git repository.
The remote system "Remote" has My C: drive mapped to its drive S:
I can see the C:\cap2office directory
as S:\cap2office
on the remote system.
And the username on the remote system is different from the username on my local system.
On Remote, I typed "git status
" and it complained about mismatching ownership and suggested defining GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true
, so I did that on the Remote system and that warning went away.
But it still says:
warning: '//tsclient/C/cap2office' is on a file system that does not record ownership
fatal: unsafe repository ('//tsclient/C/cap2office' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory '%(prefix)///tsclient/C/cap2office'
So on the Remote system, I did:
git config --global --add safe.directory S:/cap2office
On the Remote, I can do git config --list
And in addition to the error (3 times):
warning: '//tsclient/C/cap2office' is on a file system that does not record ownership
I see this at the end, so the safe.directory did get added:
safe.directory=S:/cap2office
But when I do 'git status', I still get:
warning: '//tsclient/C/cap2office' is on a file system that does not record ownership
fatal: unsafe repository ('//tsclient/C/cap2office' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory '%(prefix)///tsclient/C/cap2office'
So I also tried
git config --global --add safe.directory //tsclient/C/cap2office
warning: '//tsclient/C/cap2office' is on a file system that does not record ownership
warning: encountered old-style '//tsclient/C/cap2office' that should be '%(prefix)///tsclient/C/cap2office'
fatal: unsafe repository ('//tsclient/C/cap2office' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory '%(prefix)///tsclient/C/cap2office'
Any ideas? What should %prefix
be, maybe the drive mapping doesn't work?
BTW, I'm curious where the .gitconfig
file is located.
It doesn't appear to be C:\user\accountname\.gitconfig
as advertised or under the program files Git area.
CodePudding user response:
What should
%prefix
be, maybe the drive mapping doesn't work?
Actually, as I detailed here, you must use the actual string %(prefix)
The value of this setting is interpolated, i.e.
~/<path>
expands to a path relative to the home directory and%(prefix)/<path>
expands to a path relative to Git's (runtime) prefix.
And:
I'm curious where the .gitconfig file is located.
Do a git config --show-scope --show-origin -l
: you will see all the config files and their path.