Sync .git folders alone

I copy my projects folder, but I would like to sync the .git folders inside them. So in the end my projects folder should be copied while the .git folders inside them should be synced.

This is the filter file that I used for syncing the git folders,

+ .git/**
- * 

Tried - ** as well.

This just deleted all the .git folders from my remote instead of syncing them. Would really appreciate if someone can point me what I'm doing wrong.

Just a guess but try + **/.git/** maybe?

Can you show the full command you used? The --filter-from file looks OK I think - match a directory called .git and any of its contents anywhere in the tree.

This is the first copy script

rclone copy /mnt/windows/folder/ remote:folder/ --fast-list -v --progress --transfers=50 --checkers=60

while this is the second sync one which syncs the git folders

rclone sync /mnt/windows/folder/ remote:folder/ --fast-list --progress --transfers=50 --checkers=60 -

Is the second one intended as a top up sync so you do the first one, then top up the .git directories?

The command seems to be missing the --filter-from flag?

I suggest you try using rclone copy in both the commands until you are sure what is going on.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.