Unsync'd Git Repository in Dropbox

一世执手 提交于 2019-12-03 04:23:35

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.

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?

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!