I am using git with capistrano.
I initialized my project inside my folder on my local machine as such:
git init
Then I clicked on the project server directory. Then I called cap deploy Deployment works, except that it loads the local folder structure .git, as well as my .gitignore and Capfile into the public folder.
Here is my gitignore file:
.DS_Store uploads* Capfile .gitignore .git*
This is not like a trick. Any help?
Thanks!
Edit: Updated .gitignore file:
Deployment strategy for export has been changed:
set :deploy_via, :export
This works to ignore the .git folder, but the contents of my .gitignore file shown below are still not taken into account
.DS_Store includes/php/config.php /uploads Capfile .git
EDIT 2 (Decision): Change 1 in combination with the following trick. Files that were added before they were added to the .gitignore file will be constantly downloaded. Let's say I had the following .gitignore file.
.DS_Store includes/php/config.php
Then I executed the following commands:
git add . git commit -a -m 'some commit'
Then I decided to add .gitignore to my file so that 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 see that .DS_Store and includes/php/config.php were not loaded, but that Capfile has ... Here is what happened to me in my original question. Reason: I think the .gitignore file is only taken into account when adding (i.e. git add . ). If I had already added the files and then placed them in a .gitignore file, they would have already been added to the project. I will need to use the git rm command to remove them. I just started over from the new .git repository and this solved the problem, but you donβt need to - you can just delete all the files that you have already added, but now you want to ignore the git rm command.
I chose the answer that helped me come to this conclusion as the right one, although the complete solution was just described in detail above.