Unsync'd Git Repository in Dropbox

前端 未结 3 1546
一整个雨季
一整个雨季 2021-02-06 11:17

I have a git repository (and working directory) that is stored in my Dropbox so I can move back and forth between computers without having to commit or stash (read: without any

相关标签:
3条回答
  • 2021-02-06 11:45

    I've gotten this exact problem under the same circumstances.

    To stop the files showing in git status you can set git to ignore file mode changes:

    git config core.filemode false
    

    This change is local to the git repository and will be synced along with the files.

    0 讨论(0)
  • 2021-02-06 11:45

    You may want to check where you are setting your umask; it may be that dropbox is starting with a different umask than what your shell has. However, I believe that git ignores the group/other permissions and is mostly concerned with the execute bit, which should not be affected by the umask. Some thoughts for debugging:

    • Can you reproduce this on-demand? How?
    • What operating systems are you synchronizing between?
    • If you git checkout -f on the files in question, do they get the correct permissions?
    • If you simply chmod a file on one system, does that change get propagated?
    0 讨论(0)
  • 2021-02-06 11:55

    The fact you are using Macs is relevant - the Macworld Hints article mentioned in a comment explains the issue (but read down to the comment that explains how to fix permissions with chmod u+rwX etc, rather than absolute permissions that may mess things up).

    This Dropbox Support answer explains what's probably going on and how to fix it - related to how MacOS X Leopard (10.5) changed the default usage of ACLs.

    0 讨论(0)
提交回复
热议问题