Git hangs while writing objects

后端 未结 9 2018
执念已碎
执念已碎 2020-12-12 13:21

I\'m trying to git push -u origin master And it just hangs at

Writing objects:  99% (219/220), 12.65 MiB | 97 KiB/s

The

9条回答
  •  感动是毒
    2020-12-12 13:51

    In my case, I was using a git folder with bad rights stored on the same drive as a repo, but it could be the same with ssh even if you use an authorized login user.

    Check then if you have correct rights to write on the distant repo.

    Example:

    Init local and distant repo

    git init /tmp/src
    git init --bare /tmp/dst
    cd /tmp/src
    

    Adding remote repo to origin

    src > git remote add dest /tmp/dst
    

    Simulating problem

    src > chmod -R 555 /tmp/dst
    

    Adding fake file and pushing it

    src > touch a && git add a && git commit -m 'demo'
    src > git push --set-upstream dest master
    src > git push
    Counting objects: 3, done.
    Writing objects: 99% (2/3), 202 bytes | 0 bytes/s.
    

    Git hangs

    Solution

    src > chmod -R 775 /tmp/dst
    

提交回复
热议问题