Local git repo force updated from a remote git repo. (thick-client deployments)

后端 未结 5 644
暖寄归人
暖寄归人 2021-01-15 05:46

Update: I think this is related to an issue with the windows git client msysgit. Sorry to trouble you guys. http://code.google.com/p/msysgit/issues/detail?i

5条回答
  •  心在旅途
    2021-01-15 06:02

    For the record, this original issue seems to be limited to msysgit 1.6.5.1 (issue 379), as mentioned by the OP.

    However, that same issue mentions in 2012 a similar problem with other causes:

    For the record, I have this issue with autocrlf = false.

    Performing a git reset --hard still leaves uncommitted changes relating to file permissions:

    $ git reset --hard
    HEAD is now at 088c702 BranchA
    
    $ git diff
    
    diff --git a/path/to/file b/path/to/file
    old mode 100755
    new mode 100644
    ...
    

    This is in relation with "Removing files saying “old mode 100755 new mode 100644” from unstaged changes in git"

    I've discovered that for some reason, core.filemode was set to true on repository level (I didn't set it myself):

    $ cat .git/config
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
            ignorecase = true
    

    So: git config core.filemode false is recommended.

提交回复
热议问题