From a .bat file on Windows i’m trying to exclude all my “.git” directories but without success.
Of course, i have read the documentation.
What i have tried:
rclone.exe --exclude **.git/** sync "D:\Documents" remoteEncrypted:Documents
rclone.exe --exclude *.git/** sync "D:\Documents" remoteEncrypted:Documents
rclone.exe --exclude **/.git/** sync "D:\Documents" remoteEncrypted:Documents
rclone.exe --exclude .git/** sync "D:\Documents" remoteEncrypted:Documents
rclone.exe --exclude */.git/** sync "D:\Documents" remoteEncrypted:Documents
Any help please ?
Thanks in advance,
Well … I exclude all my cache folders with:
- */cache/** (in a filter file)
that is similar to yours:
Maybe the dot in the folder name interfere?
Thanks for your answer, how do you use a filter file ?
Maybe will it fix the dot interference.
You will have to use the
To exclude directories you can simply use
/ at the end of the filter will turn the filter into a directory filter (See https://rclone.org/filtering/#directories)
My .git folders are still uploaded with the following command from a .bat file:
rclone.exe sync "D:\Documents" remoteEncrypted:Documents --exclude .git/
Am i doing something wrong ?
Just to be sure : Does the “exclude” command work on encrypted remotes ? (on Microsoft Windows ?)
I tested this on an Windows machine and the
--exclude .git/ works for me:
C:\rclone-v1.42-windows-amd64> rclone.exe sync --exclude .git/ a b
¦ ¦ asdf.txt
¦ ¦ config
¦ ¦ description
¦ ¦ HEAD
¦ ¦ exclude
¦ ¦ +---info
¦ ¦ +---pack
If you want
sync to delete existing
.git folders in the destination, you can use
--exclude works for all remotes. rclone will transform filenames for encrypted remotes transparently for you.
Oh, thanks for your help! I missed the
What i have now:
rclone.exe sync "D:\Documents" remoteEncrypted:Documents --exclude-from=rclone-filters.txt --delete-excluded
Note that the
--dump filters flag is also usefull to investigate filter-related issues.
Thanks again! How can i flag this topic as “resolved”?