9

My code

rsync -exclude='.gitconfig' -exclude='*~' -exclude='.DS_Store' /Users/Masi/bin/ /Users/Masi/gitHub/dvorak/

I run it. It copies the .DS_Store to the destination folder although it should not.

This suggests me that the first exclusion do not work. It seems to be hard-coded in Git's default ignore -file to ignore .gitconfig.

How can you avoid the coping of .DS_Store?

4

2 回答 2

24

看起来您的“--exclude”标志上缺少一个破折号。没有它,我怀疑 rsync 认为你正在向它传递一个值为 "xclude=.DS_Store"; 的 -e 标志;根本不是你想要的。

于 2009-06-28T01:13:25.053 回答
13

Try the following. Place your list of items to exclude in a file

~/.rsync/exclude

One per line (wildcards acceptable).

Then use the appropriate option to read the exclusions from that file:

--exclude-from=~/.rsync/exclude

You may also wish to ask this on ServerFault, the sister site.

于 2009-06-27T23:44:55.090 回答