问题描述
我注意到当在 Windows 上使用 Git 扩展来init
一个裸仓库时
I noticed that when using the Git Extensions on Windows to init
a bare repository that it does
git init --bare --shared=all
我已经阅读了 --shared
选项的手册.设置文件夹权限似乎很方便,但描述非常符合 UNIX(例如 umask
).
I've read the manual for the --shared
options. It seems a convenience to set folder permissions but the descriptions are very UNIX-y (e.g. umask
).
我的远程存储库将被共享,但它们位于 Windows 身份验证下的远程 UNC 共享上.
My remote repositories are going to be shared, but they're on a remote UNC share under Windows Authentication.
那么,在我的情况下,是否需要此 --shared
选项,例如,如果我从命令提示符初始化存储库?
So, in my situation, is there any need for this --shared
option, for instance if I was initialising a repo from the command prompt?
推荐答案
除了权限(在 Windows 中确实可能不起作用),使用 --shared
标志也设置了 receive.denyNonFastForwards
配置在共享存储库中.当然你也可以手动设置,如果你想...
Except from the permissions (that indeed might not work in windows), using the --shared
flag also sets the receive.denyNonFastForwards
config in shared repositories. Of course you could also set that manually if you want to...
尝试从 git-bash
shell 运行 git init --bare --shared=all
,看看你是否收到任何关于权限的报告.
Try running git init --bare --shared=all
from a git-bash
shell, and see if you get any reports regarding permissions.
这篇关于在 Windows 中使用 git,git-init 的 --shared 选项有什么用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!