<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 12/28/2019 09:35 PM, Kevin Korb via
      rsync wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:450edb20-2dea-de44-cb13-20f48d182227@sanitarium.net">
      <pre wrap="">Order matters.  --include overrides --exclude listed later.  So, your
exclude is nullified by both of  your includes.  So move the exclude
before the includes.  Of course then your includes will be irrelevant so
just remove them unless you are leaving out details.

On 12/28/19 9:15 PM, H via rsync wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">I am having problems getting a . directory in a subdirectory to be excluded when rsyncing. I am using rsync 3.1.2 on CentOS 7 and the command line is:

#    all files from ~/bin/ and I use want to exclude the directory ~/bin/docker/.git
rsync -vHrltDium -c --chmod=Du+rwx,go-rwx,Fu+rw,go-rw --no-perms --stats --include='*' --include='*/' --exclude=".git/" -e "ssh -y -p 22" /home/user/bin/ <a class="moz-txt-link-abbreviated" href="mailto:user@1.2.3.4:~/bin">user@1.2.3.4:~/bin</a>

What am I doing wrong? I thought the exclusion pattern above would exclude any .git subdirectory regardless of level found?

Thank you.


</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <p>Thank you very much, worked perfectly! Clearly I need to read up
      on includes and excludes...<br>
    </p>
  </body>
</html>