# Git + Capistrano deploying Rails app in Mor.ph AppSpace

**URL:** <https://www.ruby-forum.com/t/git-capistrano-deploying-rails-app-in-mor-ph-appspace/168599>\
**Category:** Rails\
**Created:** [May 22, 2009, 7:20pm UTC](https://www.ruby-forum.com/t/git-capistrano-deploying-rails-app-in-mor-ph-appspace/168599 "2009-05-22T19:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gattone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gattone](https://www.ruby-forum.com/u/gattone)\
**Post date:** [May 22, 2009, 7:20pm UTC](https://www.ruby-forum.com/t/git-capistrano-deploying-rails-app-in-mor-ph-appspace/168599/1 "2009-05-22T19:20:52Z")

</div>

I have a directory for images uploaded through the admin page of my  
app.

But whenever I redeploy the app, the images in my local environment  
overwrite those in the server (which is pretty much expected, although  
undesirable).

I already tried using .gitignore and the exclude file to ignore the  
folder, but it ends up erasing all the images of the folder in the  
production environment after the deploy, which is even worse.

How do I configure git or the cap script to prevent this behavior (of  
my local images overwriting the online ones after deploy)?

I do have to prevent this behavior by only managing my git commits and  
a capistrano file, since morph app space doesn’t provide any shell  
access to the server…

I’m kind of desperate to solve this.

Sorry for any english mistakes… I’m not from an english speaking  
country.

---

<div class="post-metadata">

**Author:** ![gattone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gattone](https://www.ruby-forum.com/u/gattone)\
**Post date:** [May 22, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/git-capistrano-deploying-rails-app-in-mor-ph-appspace/168599/2 "2009-05-22T19:24:17Z")

</div>

Daniel D. wrote:

> I have a directory for images uploaded through the admin page of my  
> app.
> 
> But whenever I redeploy the app, the images in my local environment  
> overwrite those in the server (which is pretty much expected, although  
> undesirable).
> 
> I already tried using .gitignore and the exclude file to ignore the  
> folder, but it ends up erasing all the images of the folder in the  
> production environment after the deploy, which is even worse.
> 
> How do I configure git or the cap script to prevent this behavior (of  
> my local images overwriting the online ones after deploy)?

Look at how cap deals with shared/log, then do something similar. I  
have code I can share if necessary.

> Sorry for any english mistakesï¿½ Iï¿½m not from an english speaking  
> country.

Your English is fine!

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
