# Exclude Files from Capistrano / Source Control

**URL:** <https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887>\
**Category:** Rails\
**Created:** [April 19, 2009, 2:16am UTC](https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887 "2009-04-19T02:16:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 19, 2009, 2:16am UTC](https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887/1 "2009-04-19T02:16:33Z")

</div>

Hello,

I have some video clips I want to make accessible through my web server  
(through the public folder). However, they are large and I do not want  
to commit them to Git so that capistrano can automatically upload them.

What’s the best way of doing this?

Thanks,

John

---

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 19, 2009, 2:31am UTC](https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887/2 "2009-04-19T02:31:03Z")

</div>

Assuming the files are all below some common point like “public/  
big\_video\_clips/” you can just add “public/big\_video\_clips/\*” to  
the .gitignore file in the project root.

On Apr 18, 2:16 pm, John H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 19, 2009, 2:36am UTC](https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887/3 "2009-04-19T02:36:04Z")

</div>

Rick Lloyd wrote:

> Assuming the files are all below some common point like “public/  
> big\_video\_clips/” you can just add “public/big\_video\_clips/\*” to  
> the .gitignore file in the project root.
> 
> On Apr 18, 2:16ï¿½pm, John H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thanks. To confirm, Capistrano will still deploy files even if they are  
gitignored as long as they are in a subdirectory like public/big/\* ?

---

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 19, 2009, 3:09am UTC](https://www.ruby-forum.com/t/exclude-files-from-capistrano-source-control/165887/4 "2009-04-19T03:09:39Z")

</div>

On Sat, Apr 18, 2009 at 5:36 PM, John H. \<  
removed\_email\_address@domain.invalid\> wrote:

> Rick Lloyd wrote:
> 
> > Assuming the files are all below some common point like “public/  
> > big\_video\_clips/” you can just add “public/big\_video\_clips/\*” to  
> > the .gitignore file in the project root.
> > 
> > On Apr 18, 2:16ï¿½pm, John H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> Thanks. To confirm, Capistrano will still deploy files even if they are  
> gitignored as long as they are in a subdirectory like public/big/\* ?

Capistrano will only deploy files if they do not match a pattern within  
your .gitignore file. For example,

public/big/\*

will exclude all files and folders who’s parent folder is  
‘#{RAILS\_ROOT}/public/big’. If you  
need more information, I would highly recommend that you view the  
following screencast(s)  
if you haven’t done so:

> **[\#96 Git on Rails - RailsCasts](http://railscasts.com/episodes/96-git-on-rails)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

> **[\#133 Capistrano Tasks - RailsCasts](http://railscasts.com/episodes/133-capistrano-tasks)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

There are several other screencasts by the same author as well as others  
on  
the web which  
go into various degrees of detail.

Good luck,

-Conrad
