Git over samba - 无法写入sha1文件名|没有权限 [英] Git over samba - unable to write sha1 filename | Permission denied

查看:868
本文介绍了Git over samba - 无法写入sha1文件名|没有权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Windows上通过samba共享gig git时,我想通过git_extentions或tortoiseGIT提交文件时出现错误。
错误是:
错误:无法写入sha1文件名.git / objects / b4 / e819f886bf31b67c42249a0eff8e8b16cf7622:权限被拒绝
当我通过ubuntu服务器添加文件并提交文件时,它工作正常。
我也在banrch工作。

When i am usig git over samba share on windows i get an error when i want to commit a file via git_extentions or tortoiseGIT. The error is: error: unable to write sha1 filename .git/objects/b4/e819f886bf31b67c42249a0eff8e8b16cf7622: Permission denied When i add the file via the ubuntu server and commit the file it works fine. I am also working in a banrch.

我已经尝试chmod 777整个.git文件夹。

I already tryed to chmod 777 the whole .git folder.

推荐答案

我也见过这个。这是一个git缺陷,可能与它如何创建和修改文件有关。澄清问题:

I've seen this, too. It's a git defect, likely to do with how it creates and modifies files. To clarify the problem:

# mount a samba share locally. 
$ mount -t cifs options //share/project  /mnt/project

# The share contains a git checkout.
# Do some typical development.
$ cd /mnt/project
$ vi file    ## ok
$ git pull   ## ok
$ git status ## ok
$ git add file ## error!
  error: unable to create temporary sha1 filename 
  .git/objects/8b/tmp_obj_mYE1Xi: Permission denied


## But everything from the shell seems to work.
$ ls -latr .git/objects/8b/  ## ok. empty dir.
$ touch .git/objects/8b/tmp_obj_mYE1Xi ## ok.
$ echo test123> .git/objects/8b/tmp_obj_mYE1Xi ## ok.
$ cat  .git/objects/8b/tmp_obj_mYE1Xi  ## ok.
test123
$ rm  .git/objects/8b/tmp_obj_mYE1Xi  ## ok.

在git版本1.5.6.5(最新的Debian软件包)中,当您尝试 GIT-添加。如果你安装了git 1.7.3.2(最新版本),你可以添加这个文件,但是当你尝试提交时你会得到这个错误。

In git version 1.5.6.5 (latest Debian package), you get the error when you try to git-add. If you install git 1.7.3.2 (latest release), you can add the file, but you will get the error when you attempt to commit.

这篇关于Git over samba - 无法写入sha1文件名|没有权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆