I am using Ruby on Rails, the Capistrano gem and git. Long time ago I initialized git and in the .gitignore
file I stated the following:
.bundle
db/*.sqlite3
log/*.log
tmp/
One day I created a sub-directory in the /public
directory of my RoR application: /public/users/...
. Now in the latter directory I have the following file system structure:
/public/users/001/file1.png
/public/users/001/file2.png
/public/users/001/file3.png
...
/public/users/002/file1.png
/public/users/002/file2.png
/public/users/002/file3.png
...
...
At this time git is tracking all file in the /public
directory including all directories and files inside /public/users/
. So, when I deploy with Capistrano, all those will be updated on the remote machine, as well.
What I would like to do is to do not track anymore public/users
directories, subdirectories and files (on my local machine) so that on the remote machine those will be not updated. That is, I would like to make possible that when I deploy with Capistrano all that is related to the public/users
(on the remote machine) is untouched.
How can I do that?
P.S.: I read a lot of other questions and answers (eg: 1, 2, ...) but all them seem do not work for me.
I am almost sure that I must add the following text line to the .gitignore
file:
# Ignoring "public/users/" directories, sub-directories and files
public/users/
and then (if the above code is valid) what I should do?