【问题标题】:Cannot get rsync to ignore my git folder and my todo file无法让 rsync 忽略我的 git 文件夹和我的 todo 文件
【发布时间】:2014-10-15 10:38:14
【问题描述】:

我正在将网页上传到我的服务器,我只是希望 rsync 忽略 3 件事:.git/ 文件夹、我的 .gitignore 文件和我的 TODO。我尝试了几种格式。我的最新命令是:

rsync -avz --include "*" --exclude .git/ --exclude .gitignore --exclude TODO --del ariela@pc01:/home/web/taskadmin /home/web/tests/

但是,所有不需要的文件仍在被复制。我不明白。我做错了什么?

【问题讨论】:

  • 你不应该使用'.git','.gitignore'(我的意思是你应该使用单引号吗?)。您是否尝试将所有目录放在一个文件中并使用 --exclude-from '/home/mydir/exclude.txt'?
  • 我添加了单引号,结果相同。它仍然复制了 .git 文件夹(和其他东西)

标签: rsync


【解决方案1】:

默认情况下包含所有文件。只需排除您不想被复制的那些

rsync -avz --exclude .git/ --exclude .gitignore --exclude TODO --del ariela@pc01:/home/web/taskadmin /home/web/tests/

【讨论】:

    猜你喜欢
    • 2018-10-15
    • 2023-03-17
    • 2014-07-31
    • 1970-01-01
    • 1970-01-01
    • 2014-10-24
    • 2016-04-09
    • 2014-05-06
    相关资源
    最近更新 更多