I recently wanted to sync my
.gitignore files across two directories. I think
rsync should be able to handle this, but I wanted to have more control on the process and decided to write a shell script.
The below shell script worked worked great! Replace
DEST_DIR with the absolute directory path.
#!/bin/bash cd "SOURCE_DIR" for f in $(find . -name ".gitignore"); do echo $f cp $f "DEST_DIR/$f" done
Subscribe to Santosh writes here
Get the latest posts delivered right to your inbox