- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 WSL1(Windows Linux 子系统)和 Ubuntu 20.04.1 LTS 开发 Win10。我有一个 Samba (1.0) 网络共享,我想通过我的 Ubuntu 终端在上面创建我的 git 存储库。
christian@my_pc:~/p/git_test$ ll
total 2048
drwxr-xr-x 1 christian christian 512 Jan 19 11:13 ./
drwxr-xr-x 1 christian christian 512 Jan 19 10:11 ../
-rwxr--r-- 1 christian christian 0 Jan 19 10:12 my_code_file.rb
我可以 git init
没有问题,但是,当我尝试 git add
一个文件时,我得到这个错误:
christian@my_pc:~/p/git_test$ git add my_code_file.rb
error: insufficient permission for adding an object to repository database .git/objects
error: my_code_file.rb: failed to insert into database
error: unable to index file 'my_code_file.rb'
fatal: adding files failed
然而,据我所知,权限是正确的。所有文件都属于 christian:christian。这棵树看起来像这样:
.git
├── [-rwxr--r--] HEAD
├── [drwxr-xr-x] branches
├── [-rwxr--r--] config
├── [-rwxr--r--] description
├── [drwxr-xr-x] hooks
│ ├── [-rwxr--r--] applypatch-msg.sample
│ ├── [-rwxr--r--] commit-msg.sample
│ ├── [-rwxr--r--] fsmonitor-watchman.sample
│ ├── [-rwxr--r--] post-update.sample
│ ├── [-rwxr--r--] pre-applypatch.sample
│ ├── [-rwxr--r--] pre-commit.sample
│ ├── [-rwxr--r--] pre-merge-commit.sample
│ ├── [-rwxr--r--] pre-push.sample
│ ├── [-rwxr--r--] pre-rebase.sample
│ ├── [-rwxr--r--] pre-receive.sample
│ ├── [-rwxr--r--] prepare-commit-msg.sample
│ └── [-rwxr--r--] update.sample
├── [drwxr-xr-x] info
│ └── [-rwxr--r--] exclude
├── [drwxr-xr-x] objects
│ ├── [drwxr-xr-x] e6
│ │ └── [-r-xr--r--] tmp_obj_mZzHwy
│ ├── [drwxr-xr-x] info
│ └── [drwxr-xr-x] pack
└── [drwxr-xr-x] refs
├── [drwxr-xr-x] heads
└── [drwxr-xr-x] tags
10 directories, 17 files
奇怪的是,在 git add my_code_file.rb
之后,我无法再删除 .git
目录,未经许可错误:
christian@my_pc:~/p/git_test$ rm -rf .git
rm: cannot remove '.git/objects/e6/tmp_obj_mZzHwy': Permission denied
似乎 git 创建了 tmp_obj_mZzHwy
没有给我删除它的权限,我想这不应该。
git add my_code_file.rb
.git
文件夹的权限
christian@my_pc:~/p/git_test$ ls -lahR .git
.git:
total 0
drwxr-xr-x 1 christian christian 512 Jan 19 11:14 .
drwxr-xr-x 1 christian christian 512 Jan 19 11:13 ..
drwxr-xr-x 1 christian christian 512 Jan 19 11:14 objects
.git/objects:
total 0
drwxr-xr-x 1 christian christian 512 Jan 19 11:14 .
drwxr-xr-x 1 christian christian 512 Jan 19 11:14 ..
drwxr-xr-x 1 christian christian 512 Jan 19 11:13 e6
.git/objects/e6:
total 1.0M
drwxr-xr-x 1 christian christian 512 Jan 19 11:13 .
drwxr-xr-x 1 christian christian 512 Jan 19 11:14 ..
-r-xr--r-- 1 christian christian 0 Jan 19 11:13 tmp_obj_mZzHwy
我正在使用的 Samba 共享在 Win10 上安装为驱动器(带字母 P:)。在我的 WSL Ubuntu 上,我通过 /etc/fstab
使用以下行安装它:
P:▸ /mnt/p▸ drvfs▸defaults,metadata,rw,exec,uid=christian,gid=christian,umask=22,fmask=11▸0 0
repo 的我的 .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
我已经尝试解决的问题:
chmod -R u+rwx .
git init --shared=all
掩码 0000
在我的主目录(resp. 非 samba 驱动器)git init/add
工作没有问题。
我发现 samba 共享没有正确挂载,元数据选项丢失 resp。每当我安装它时,都会被忽略。我认为这可能是问题所在!但是,我不清楚为什么它会被忽略,或者是否有强制执行它的方法?
TARGET SOURCE FSTYPE OPTIONS
/ rootfs wslfs rw,noatime
...
├─/mnt/p P: drvfs rw,noatime,uid=1000,gid=1000,case=off
└─/mnt/c C:\ drvfs rw,noatime,uid=1000,gid=1000,metadata,case=off
最佳答案
除了 WSL2,您可能还会遇到另一个错误,因为最近的 Git 中包含 built-in File System Monitor。
在 Git 2.38(2022 年第 3 季度)中,内置的 fsmonitor 拒绝在网络安装的存储库上工作;引入了一个供用户覆盖的配置旋钮。
参见 commit 85dc0da 的 Eric DeCosta (edecosta-mw
)(2022 年 8 月 11 日)。
(由 Junio C Hamano -- gitster
-- 合并到 commit 0479138 ,2022 年 9 月 13 日)
fsmonitor
: option to allow fsmonitor to run against network-mounted reposSigned-off-by: Eric DeCosta
Though perhaps not common, there are use cases where users have large, network-mounted repos.
Having the ability to run fsmonitor against network paths would benefit those users.Most modern Samba-based filers have the necessary support to enable fsmonitor on network-mounted repos.
As a first step towards enabling fsmonitor to work against network-mounted repos, introduce a configuration option, 'fsmonitor.allowRemote
'.
Setting this option to true will override the default behavior (erroring-out) when a network-mounted repo is detected by fsmonitor.
这来自 With Git 2.37 (Q2 2022),它阐明了与网络驱动器的不兼容性:
See commit 3294ca6 , commit 53fcfbc , commit eb29901 , commit 00991e1 , commit 9915e08 , commit d6d58ff , commit caa9c37 , commit f954c7b , commit 7667f9d , commit b533708 , commit 95a4e78 , commit de7e0b5 , commit 6504cfd , commit 90a70fa , commit d060555 , commit 207534e , commit 802aa31 , commit 39664e9 , commit 8e8f4b8 , commit 9968ed7 , commit ddc5dac , commit d989b26 , commit 1e7be10 , commit a85ad67、commit 5c58fbd、commit d33c804、commit 62a62a2、commit 49b398a、commit 27b5d41、commit 40f865d(2022 年 5 月 26 日)作者:Jeff Hostetler (Jeff-Hostetler
)。
请参阅 commit 852e2c8 的 Junio C Hamano (gitster
)(2022 年 3 月 25 日)。
(由 Junio C Hamano -- gitster
-- 合并到 commit 9e496ff ,2022 年 6 月 10 日)
fsmonitor-settings
: NTFS and FAT32 on MacOS are incompatibleSigned-off-by: Jeff Hostetler
On MacOS mark repos on NTFS or FAT32 volumes as incompatible.
The builtin FSMonitor used Unix domain sockets on MacOS for IPC with clients.
These sockets are kept in the .git directory.
Unix sockets are not supported by NTFS and FAT32, so the daemon cannot start up.Test for this during our compatibility checking so that client commands do not keep trying to start the daemon.
Remote working directories are problematic for FSMonitor.
The underlying file system on the server machine and/or the remotemount type (NFS, SAMBA, etc.) dictates whether notification eventsare available at all to remote client machines.
Kernel differences between the server and client machines alsodictate the how (buffering, frequency, de-dup) the events aredelivered to client machine processes.
A client machine (such as a laptop) may choose to suspend/resumeand it is unclear (without lots of testing) whether the watcher canresync after a resume.
We might be able to treat this as a normal"events were dropped by the kernel" event and do our normal "flushand resync" --or-- we might need to close the existing (zombie?)notification fd and create a new one.In theory, the above issues need to be addressed whether we areusing the Hook or IPC API.
For the builtin FSMonitor, we create the Unix domain socket for theIPC in the
.git
directory.If the working directory is remote,then the socket will be created on the remote file system.
This can fail if the remote file system does not support UDS file types(e.g. smbfs to a Windows server) or if the remote kernel does notallow a non-local process to bind() the socket.
(These problemscould be fixed by moving the UDS out of the.git
directory and to awell-known local directory on the client machine, but care shouldbe taken to ensure that$HOME
is actually local and not a managedfile share).So (for now at least), mark remote working directories asincompatible.
FAT32 and NTFS working directories are problematic too.
The builtin FSMonitor uses a Unix domain socket in the
.git
directory for IPC.
These Windows drive formats do not supportUnix domain sockets, so mark them as incompatible for the daemon.
在 Git 2.39(2022 年第 4 季度)中,默认情况下禁用在网络文件系统上的存储库上使用 fsmonitor。
添加旋钮以使其在 macOS 上可用。
参见 commit c4f9490 的 Jeff King (peff
)(2022 年 10 月 10 日)。
参见 commit 5aa9e32 、 commit 25c2cab 、 commit 12fd27d 、 commit 8f44976 、 commit 6beb268 、 commit 508c1a5 (2022 年 10 月 4 日),作者 Eric DeCosta (edecosta-mw
)。
(由 Junio C Hamano -- gitster
-- 合并到 commit 7b8cfe3 ,2022 年 10 月 17 日)
fsmonitor
: add documentation for allowRemote and socketDir optionsSigned-off-by: Eric DeCosta
Add documentation for 'fsmonitor.allowRemote' and 'fsmonitor.socketDir'.
Call-out experimental nature of 'fsmonitor.allowRemote' and limited filesystem support for 'fsmonitor.socketDir'.
git config
现在包含在其 man page 中:
fsmonitor.allowRemote
By default, the fsmonitor daemon refuses to work against network-mountedrepositories. Setting
fsmonitor.allowRemote
totrue
overrides thisbehavior. Only respected whencore.fsmonitor
is set totrue
.
git fsmonitor--daemon
现在包含在其 man page 中:
By default, the fsmonitor daemon refuses to work against network-mountedrepositories; this may be overridden by setting
fsmonitor.allowRemote
totrue
. Note, however, that the fsmonitor daemon is not guaranteed to workcorrectly with all network-mounted repositories and such use is consideredexperimental.
Git 2.39(2022 年第 4 季度)修复了 macOS 上的 core.fsmonitor
不会注意到创建或修改的符号链接(symbolic link)的问题。
参见 commit ee0e7fc 的 srz_zumix (srz-zumix
)(2022 年 11 月 8 日)。
(由 Junio C Hamano -- gitster
-- 于 2022 年 11 月 23 日在 commit 8d7b35b 中合并)
fsmonitor--daemon
: on macOS support symlinkSigned-off-by: srz_zumix
Signed-off-by: Taylor Blau
Resolves a problem where symbolic links were not showing up in diff when created or modified.
kFSEventStreamEventFlagItemIsSymlink
is also treated as a file update.
This is becausekFSEventStreamEventFlagItemIsFile
is not included inFSEvents
when creating or deleting symbolic links.
For example:$ ln -snf t test
fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|
$ ln -snf ci test
fsevent: '/path/to/dir/test', flags=0x40200 ItemIsSymlink|ItemRemoved|
fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|
关于permissions - WSL+samba+git : "error: insufficient permission for adding an object to repository database .git/objects"/git-clone/git-add permission errors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65790476/
我遵循了一本名为“Sitepoint Full Stack Javascript with MEAN”的书中的教程,我刚刚完成了第 6 章,应该已经创建了一个带有“数据库”的“服务器”。数据库只不过是
在 Jquery 中,我创建两个数组,一个嵌入另一个数组,就像这样...... arrayOne = [{name:'a',value:1}, {name:'b',value:2}] var arra
这个问题在这里已经有了答案: What is the explanation for these bizarre JavaScript behaviours mentioned in the 'Wa
我被放在别人的代码上,有一个类用作其他组件的基础。当我尝试 ng serve --aot(或 build --prod)时,我得到以下信息。 @Component({ ...,
我正在测试一些代码,并使用数据创建了一个 json 文件。 问题是我在警报中收到“[object Object],[object Object]”。没有数据。 我做错了什么? 这是代码:
我想打印 [object Object],[object Object] 以明智地 "[[{ 'x': '1', 'y': '0' }, { 'x': '2', 'y': '1' }]]"; 在 ja
我有一个功能 View ,我正在尝试以特殊格式的方式输出。但我无法让列表功能正常工作。 我得到的唯一返回是[object Object][object Object] [object Object]
在使用优秀的 Sim.js 和 Three.js 库处理 WebGL 项目时,我偶然发现了下一个问题: 一路走来,它使用了 THREE.Ray 的下一个构造函数: var ray = new THRE
我正在使用 Material UI 进行多重选择。这是我的代码。 {listStates.map(col => (
我的代码使用ajax: $("#keyword").keyup(function() { var keyword = $("#keyword").val(); if (keyword.
我遇到了下一个错误,无法理解如何解决它。 Can't resolve all parameters for AuthenticationService: ([object Object], ?, [o
我正在尝试创建一个显示动态复选框的表单,至少应选中其中一个才能继续。我还需要获取一组选中的复选框。 这是组件的代码: import { Component, OnInit } from '@angul
我正在开发 NodeJs 应用程序,它是博客应用程序。我使用了快速验证器,我尝试在 UI 端使用快速闪存消息将帖子保存在数据库中之前使用闪存消息验证数据,我成功地将数据保存在数据库中,但在提交表单后消
我知道有些人问了同样的问题并得到了解答。我已经查看了所有这些,但仍然无法解决我的问题。我有一个 jquery snipet,它将值发送到处理程序,处理程序处理来自 JS 的值并将数据作为 JSON 数
我继承了一个非常草率的项目,我的任务是解释为什么它不好。我注意到他们在整个代码中都进行了这样的比较 (IQueryable).FirstOrDefault(x => x.Facility == fac
我只是在删除数组中的对象时偶然发现了这一点。 代码如下: friends = []; friends.push( { a: 'Nexus', b: 'Muffi
这两个代码片段有什么区别: object = nil; [object release] 对比 [object release]; object = nil; 哪个是最佳实践? 最佳答案 object
我应该为其他人将从中继承的第一个父对象传递哪个参数,哪个参数更有效 Object.create(Object.prototype) Object.create(Object) Object.creat
我在不同的对象上安排不同的选择器 [self performSelector:@selector(doSmth) withObject:objectA afterDelay:1]; [self per
NSLog(@"%p", &object); 和 NSLog(@"%p", object); 有什么区别? 两者似乎都打印出一个内存地址,但我不确定哪个是对象的实际内存地址。 最佳答案 这就是我喜欢的
我是一名优秀的程序员,十分优秀!