Reputation: 16761
In Capistrano 2 it was possible to exclude certain files that live in the Git repository with copy_exclude:
set :copy_exclude, %w{.git .DS_Store web concept config lib}
This isn't possible anymore in Capistrano 3. How can I exclude certain files that I want in my Git repository but not necessarily on my server?
Upvotes: 5
Views: 1595
Reputation: 16761
The way to achieve this is to add a .gitattributes
to the root of your repo. It works very similar to .gitignore
. Just add the paths to all the files you want in your repository but not on your staging / production server followed by export-ignore
and commit+push the changes.
Sample .gitattributes
file:
# Folders
/config export-ignore
/lib export-ignore
# Files
license.txt export-ignore
readme.html export-ignore
Then deploy like usual. More info here
Upvotes: 5