4

我在使用 git 时遇到了一些问题。希望有人有一些建议。
我有一个位于 NAS 驱动器上的主存储库。然后我在 linux(ubuntu 12.04 服务器)上有用户存储库。NAS 驱动器使用 CIFS 安装在 linux 服务器上,因此在从/向远程存储库传输文件时不需要 HTTP 或 SSH。

当我尝试从用户存储库推送到 NAS 上的主存储库时,我总是收到与无法在 NAS 上设置权限位相关的错误。在过去的几天里,我对此进行了很多研究,尽管所有用户都对 NAS 具有读/写文件权限,但由于 NAS 的工作方式,您无法通过 chmod 更改权限位。在 NAS 上创建的文件的权限位由挂载命令参数(file_mode、dir_mode 等)设置。

这是我尝试从用户存储库推送到 NAS 上的主存储库时遇到的错误:

dba@clp01:~/slave_repository.git$ git push master_git
Counting objects: 6, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 2.52 KiB, done.
Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
error: cannot fix permission bits on refs/heads/master.lock
fatal: Unable to create
'/mnt/nassource/master_repository.git/.git/refs/heads/master.lock': 
Operation not permitted
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
dba@clp01:~/slave_repository.git$ git config --global --list
user.name=DBA
user.email=dba@cont.com
core.editor=emacs
core.filemode=false
merge.tool=diff

任何建议将不胜感激......

4

2 回答 2

0

几分钟前我遇到了这个问题。我尝试touch在远程服务器上创建一个新文件,但失败了。所以我用sudo git push theRemote了它,它奏效了。可能不是最聪明的事情,但在我的情况下,它被挂在一个 .lock 文件上,没有其他人推送到这个 repo,所以很好。

于 2013-05-09T23:06:23.953 回答
0

你的 NAS 支持 NFS 吗?对你来说可能是一个更好的选择。

于 2012-11-23T17:05:53.740 回答