Thursday, January 6, 2011

Best practice for ignoring files within a folder with GIT

Programmer Question

I'm just looking for some advice on the best way to manage the following situation with git.



my project has a folder called "photos" that users can upload images to.



I have a version of the project running locally and I am adding images to this folder for testing purposes.



When I push to the live server I want the "photos" folder to get pushed but not the images within it. Also when users add images to the "photos" folder on the live server I want GIT to ignore them.



I know I need to use Git Ignore but I'm unsure what the best way to do this is.



Should I just add "photos" to the git ignore file and then manually create the "photos" folder on the live server?



Thanks in advance.



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails