首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git错误“[我的存储库]在不记录所有权的文件系统上”

git错误“[我的存储库]在不记录所有权的文件系统上”
EN

Stack Overflow用户
提问于 2022-07-16 23:09:35
回答 1查看 3.6K关注 0票数 1

我在运行VPN和RDP的两个W10系统之间出现了这个错误。我的本地系统"My“有一个区域c:\cap2office,它是一个Git存储库。

远程系统" remote“将我的C:驱动器映射到它的驱动器S:我可以在远程系统上看到C:\cap2office directory作为S:\cap2office

而且远程系统上的用户名与本地系统上的用户名不同。

在远程上,我输入了"git status“,它抱怨所有权不匹配,并建议定义GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true,所以我在远程系统上这样做,警告就消失了。

但它仍然说:

代码语言:javascript
复制
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'

所以在远程系统上,我做到了:

代码语言:javascript
复制
git config --global --add safe.directory S:/cap2office

在遥控器上,我可以做git config --list

除了错误(3次)外:

代码语言:javascript
复制
   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

但是当我做“git状态”时,我仍然得到:

代码语言:javascript
复制
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'

所以我也试过

代码语言:javascript
复制
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'

有什么想法吗?%prefix应该是什么,也许驱动器映射不起作用?

顺便说一句,我很好奇.gitconfig文件在哪里。

它似乎不是C:\user\accountname\.gitconfig的广告或程序文件的Git区域。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-17 00:25:30

%prefix应该是什么,也许驱动器映射不起作用?

实际上,作为我detailed here,您必须使用实际的字符串%(prefix)

此设置的值被内插,即

  • ~/<path>扩展为相对于主目录的路径,and
  • %(prefix)/<path>扩展为相对于Git的(运行时)前缀的路径。

和:

我很好奇.gitconfig文件在哪里。

执行git config --show-scope --show-origin -l:您将看到所有配置文件及其路径。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73008213

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档