Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:20:59+00:00 2026-05-16T07:20:59+00:00

I am using git with capistrano. I initialized my project inside my folder on

  • 0

I am using git with capistrano.

I initialized my project inside my folder on my local machine as such:

git init

I then pushed the project the server directory
I then called cap deploy
The deploy works, except that it uploads the local .git folder structure, as well as my .gitignore and Capfile to a publicly accessible folder.

Here’s my gitignore file:

.DS_Store
uploads/**/*
Capfile
.gitignore
.git/**/*

This doesn’t seem to do the trick. Any help?

Thanks!


Edit: updated .gitignore file:

Changed deployment strategy to export:

set :deploy_via, :export

This works for ignoring the .git folder, but the contents of my .gitignore file seen below are still not taken into account

.DS_Store
includes/php/config.php
/uploads
Capfile
.git





EDIT 2 (Solution): Edit 1 in combination with the following did the trick.
Files that were already added prior to being listed in the .gitignore file would constantly be uploaded. Say I had the following .gitignore file.

.DS_Store
includes/php/config.php

Then I ran the following commands:

git add .
git commit -a -m 'some commit'

Then I decided to add to my .gitignore file so it now looks like this:

.DS_Store
includes/php/config.php
Capfile

Then again, I ran:

git add .
git commit -a -m 'another commit'

Now I’d see that .DS_Store and includes/php/config.php have not been uploaded, but that the Capfile has… This is what happened to me in my original question.
The reason: I think the .gitignore file is taken into account only when adding (i.e. git add .). If I already added files, then put them in the .gitignore file, they would have already been added to the project. I’d need to use the git rm command to remove them.
I just started anew with a new .git repo and that solved the problem, but you don’t have to – you can just remove whatever files you already added but now want to ignore with the git rm command.

I selected the answer that helped me get to this conclusion as the right one, though the complete solution was just detailed above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:21:00+00:00Added an answer on May 16, 2026 at 7:21 am

    What is your deploy strategy?

    Do you have Capistrano setup to exclude the .git file?
    if you are using set :deploy_via, :copy then make sure to add the following:

    set :copy_exclude, [".git/*", ".svn/*", ".DS_Store"]

    Otherwise use set :deploy_via, :export which should ignore your source control folders

    http://www.capify.org/index.php/Understanding_Deployment_Strategies

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I cannot reproduce. With the following entity: @Entity public class… May 16, 2026 at 5:34 pm
  • Editorial Team
    Editorial Team added an answer See: http://developer.apple.com/tools/xcode/xcodebuildsettings.html Basically, you need to go to the "Build"… May 16, 2026 at 5:34 pm
  • Editorial Team
    Editorial Team added an answer The bot is discarding session info and ignoring your cookies.… May 16, 2026 at 5:34 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am new to using git and Capistrano. I have setup everything else on
Using Ruby on Rails combined with capistrano and git, I've run into an annoying
I created centralized git repositories on my department's sun solaris server using mkdir /var/git/myapp.git
I am using Capistrano to deploy a ruby on rails project. I am attempting
I am using git and I have two branches: production and master. At this
I'm trying to deploy my rails application by using Passenger and Capistrano on Dreamhost.
At my company we're using git for a couple of months now (and we're
Using Git Bash on Windows, if I create a bash script, where do I
I am using git add -i to select patch hunks to add or not.
Before I started using Git as my SCM, I would throughly test the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.