Git init: fatal: could not set 'core.filemode' to 'false'

前端 未结 2 2565
日久生厌
日久生厌 2021-01-05 07:47

Using Team City to check out from a Git Repo. (Gitlabs if it matters)

Start with Empty build directory. Get this error:

fatal: could not set \'core.filemode

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 08:30

    In my case using "sudo" worked for me. For example:

    asif@asif-vm:/mnt/prog/protobuf_tut$ git clone https://github.com/protocolbuffers/protobuf.git
    Cloning into 'protobuf'...
    error: chmod on /mnt/prog/protobuf_tut/protobuf/.git/config.lock failed: Operation not permitted
    fatal: could not set 'core.filemode' to 'false'
    

    After doing a "sudo" I could get it working:

    asif@asif-vm:/mnt/prog/protobuf_tut$ sudo git clone https://github.com/protocolbuffers/protobuf.git
    Cloning into 'protobuf'...
    remote: Enumerating objects: 5, done.
    remote: Counting objects: 100% (5/5), done.
    remote: Compressing objects: 100% (5/5), done.
    remote: Total 66782 (delta 0), reused 0 (delta 0), pack-reused 66777
    Receiving objects: 100% (66782/66782), 55.83 MiB | 2.04 MiB/s, done.
    Resolving deltas: 100% (45472/45472), done.
    Checking out files: 100% (2221/2221), done.
    

提交回复
热议问题