I tried using rsync --filter=':+ .gitignore'
(-/exclude works but not include) to no avail.
Basically i just want to include the .ignore file in a script and upload everything in it with rsync to the remote.
If anyone would have the skills to sed or awk .gitignore into a file suitable for include with --filter='merge file'
etc it would me much appreciated!
Or alternatively a way just to make rsync understand .gitignore for inclusion.
https://www.kernel.org/pub/software/scm/git/docs/gitignore.html 'PATTERN FORMAT'
http://linux.die.net/man/3/fnmatch
https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.txt;hb=HEAD
https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.c;hb=HEAD
Some Issues are in rsync bla/
means just that dir, bla/*
means just the files in that dir, bla/**
means just everything under that dir (including subdirs) and bla/***
finally means bla and all it's contents but all git might have is bla/
But exclude rules seem compatible.
Perhaps something like this: (Again, untested)
git ls-files -oz | rsync --include-from=- --from0
I recommend using gsync rather than rsync
. I wrote it because:
I have a project with the following characteristics:
.gitignore
in the root directory is 60+ lines long.gitignore
.gitignore
files include lines with !
-style exceptionsI tried the methods in other answers. Some were promising but ultimately I hit the discarding over-long filter
error. So I wrote gsync as a wrapper script for rsync
to properly handle .gitignore
files (in subdirs, with support for !
-style exceptions. I think you'll find it helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With