Scripts

Vote Up Down

6

Vote down!

How to remove all .DS_Store, ._* files in a folder

If you want to recursively delete all .DS_Store files in a subfolder, you can run the following commands. First, see what is being deleted:

find . -name '.DS_Store' -type f

Then, delete those files:

find . -name '.DS_Store' -type f -delete

And also:

find . -name "\._*" -exec rm {} \;

.^.

Vote Up Down

-9

Vote down!

How to push to two github remotes at once

For the purposes of backup and resilience, it may be useful to maintain two identical git remotes for a repo. Maybe one is on github, and another one is on a machine on another cloud. Then, you may want to automate pushing every change to the two repos at once.

git remote set-url       --push origin git@github.com:<username>/<reponame>.git
git remote set-url --add --push origin git@git:/home/git/repos/
git push origin

Push to multiple remotes. Add the hosted Git server as a remote: