• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yueyoum
V2EX  ›  程序员

GIT 问题

  •  
  •   yueyoum ·
    yueyoum · Jun 20, 2014 · 5146 views
    This topic created in 4371 days ago, the information mentioned may be changed or developed.
    内网部署的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 replies    2016-03-30 16:53:34 +08:00
    maxiujun
        1
    maxiujun  
       Jun 20, 2014
    看样子使用的是 http 吧, http 问题比较多.
    yueyoum
        2
    yueyoum  
    OP
       Jun 20, 2014
    @maxiujun

    不是, 用的 sshkey
    TankyWoo
        3
    TankyWoo  
       Jun 20, 2014
    确认下 .git/objects/ 以及里面的权限

    本地用strace跟踪下

    gitlab服务端没日志吗?
    yueyoum
        4
    yueyoum  
    OP
       Jun 20, 2014
    @TankyWoo

    .git/objects 都是 git:git


    同事那儿是 windows 机器

    gitlab 日志完全正常,看不出任何异常
    maxiujun
        5
    maxiujun  
       Jun 20, 2014
    是不是 push 的东西太大了?
    yueyoum
        6
    yueyoum  
    OP
       Jun 20, 2014
    @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  
       Jun 20, 2014
    先用户ssh过去,看权限。
    JeffenCheung
        8
    JeffenCheung  
       Mar 30, 2016
    以下 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3264 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 12:17 · PVG 20:17 · LAX 05:17 · JFK 08:17
    ♥ Do have faith in what you're doing.