V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yueyoum
V2EX  ›  程序员

GIT 问题

  •  
  •   yueyoum ·
    yueyoum · 2014-06-20 12:36:18 +08:00 · 4396 次点击
    这是一个创建于 3599 天前的主题,其中的信息可能已经有所发展或是发生改变。
    内网部署的gitlab

    一直用的也没问题,
    今天同事windows机器 无法 push

    git push origin master
    报错为

    git fatal sha1 file ' stdout ' write error invalid argument

    google了半天都说是 远端git仓库 没有写入权限,要把仓库 chown git:git DIR

    但 :

    1. 仓库确实是属于 git:git的
    2. 一直好好的, 突然就出问题了。


    求解?
    8 条回复    2016-03-30 16:53:34 +08:00
    maxiujun
        1
    maxiujun  
       2014-06-20 12:40:12 +08:00
    看样子使用的是 http 吧, http 问题比较多.
    yueyoum
        2
    yueyoum  
    OP
       2014-06-20 12:53:19 +08:00
    @maxiujun

    不是, 用的 sshkey
    TankyWoo
        3
    TankyWoo  
       2014-06-20 14:19:27 +08:00
    确认下 .git/objects/ 以及里面的权限

    本地用strace跟踪下

    gitlab服务端没日志吗?
    yueyoum
        4
    yueyoum  
    OP
       2014-06-20 14:51:47 +08:00
    @TankyWoo

    .git/objects 都是 git:git


    同事那儿是 windows 机器

    gitlab 日志完全正常,看不出任何异常
    maxiujun
        5
    maxiujun  
       2014-06-20 15:04:08 +08:00
    是不是 push 的东西太大了?
    yueyoum
        6
    yueyoum  
    OP
       2014-06-20 15:21:51 +08:00
    @maxiujun

    可能是,

    那个仓库有很多 二进制文件,

    但是我也添加了 这些配置


    [core]
    autocrlf = input
    packedGitLimit = 128m
    packedGitWindowsSize = 128m
    [pack]
    windowMemory = 128m
    packSizeLimit = 128m
    deltaCacheSize = 128m
    threads = 1


    依然不行

    git gc
    git repack remote/origin/master
    git fsck

    都做过了
    standin000
        7
    standin000  
       2014-06-20 16:32:33 +08:00
    先用户ssh过去,看权限。
    JeffenCheung
        8
    JeffenCheung  
       2016-03-30 16:53:34 +08:00
    以下 Stack Overflow 的 Winfield 方案可行:
    http://stackoverflow.com/questions/20310718/git-push-results-in-fatal-sha1-file-stdout-write-error-invalid-argument

    upd. via.
    if the latest commit has already been pushed, create a NOOP commit and force-deploy it:
    touch foo.txt
    git add foo.txt
    git commit -m 'NOOP'
    git push -u origin master --force
    ...and if that works, you can remove the NOOP commit you made locally:
    git reset --hard master
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   915 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 19:55 · PVG 03:55 · LAX 12:55 · JFK 15:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.