我在使用git时遇到了一些麻烦。希望有人有一些建议 我有一个位于NAS驱动器上的主存储库。然后我在linux(ubuntu 12.04服务器)上有用户存储库。 NAS驱动器使用CIFS安装在Linux服务器上,因此在从/向远程存储库传输文件时不需要HTTP或SSH。
当我尝试从用户存储库推送到NAS上的主存储库时,我始终遇到与无法在NAS上设置权限位相关的错误。我在过去的几天里研究过这个很多,尽管所有用户都在NAS上有读/写文件权限,但由于NAS的工作方式,你无法通过chmod来改变权限位。在NAS上创建的文件的权限位是从mount命令参数(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
任何建议都会受到高度赞赏......
答案 0 :(得分:0)
您的NAS是否支持NFS?对你来说可能是更好的选择。
答案 1 :(得分:0)
touch
新文件,但它失败了。所以我使用sudo git push theRemote
并且它有效。可能不是最聪明的东西,但在我的情况下,它被挂在.lock文件上,没有其他人推送到这个回购,所以没关系。