Tim Habersack

Where I put my things..

Content tagged #git

A nice place to store git repos; allthe.codes

Feb 28th 2019

I have been handed the reigns of the domain allthe.codes, and am in the process of turning a part of a server into a nice little remote #git web interface thing.

I will be attempting to utilize cgit first!

Using your .gitignore as your rsync filter

Feb 21st 2019

This is always pesky. You have a project and you're using #git as your version control. You have a well manicured .gitignore file to handle certain things out of your repo.

But! then you need to push everything via #rsync somewhere. Maybe that's your deploy strategy, I don't know. I'm not a doctor. I do know that using the rsync --exclude to call out each single directory and file you don't want pushed over is a super pain. And you already have this .gitignore just sitting there, that holds that kind of list already!

Enter --filter.

If you do something like:

rsync -avz --filter=':- .gitignore' dir/ user@server:/path/to/destination

It will only push over the items that your .gitignore would allow to be pushed up to your repo. Excellent, yes?