Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two folders:

  • /home/me/code/project/
  • /srv/www/projectfiles/

In the /home/me/code/project folder, I have symlinked static to /srv/www/projectfiles/

i.e. /home/me/code/project/static/ -> /srv/www/projectfiles/

When I try to commit now, it doesn't see any of the files behind the symlink, and instead tries to commit the symlink itself as a file.

How do I commit a file (e.g. /srv/www/projectfiles/style.css)s that is behind the symlink?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

A workaround would be to have /srv/www/projectfiles be a symlink to /home/me/code/project/static so git sees no symlinks

share|improve this answer

Move the files into the folder and remove the symlink. Git doesn't traverse symlinks.

It (and I) would assume that you are symlinking to a set of files that you either don't control or don't want to modify, as such they don't need to be versioned.

share|improve this answer
    
I do control these files. They are the stylesheets etc. and need to be in a directory which the server will server. –  Macha Aug 11 '10 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.