gitignore

How can I write a rule in gitignore to ignore all files except directories in some directory?

So lets say I have a directory structure like so uploads/ --dir1/ ----one.txt ----two.txt ----dir2/ ------one.txt ------two.txt I would like any directory and sub directories of uploads to be tracked but not any files in it with the exception of a dummy file because git doesn't track directories. I would think something like this w...

gitignore and how to ignore a common directory name and its contents

I've been pulling out my hair researching the net and various docs about .gitignore files. I'm a bit of a n00b with Unix/Terminal (using Mac OS X) and I can't for the life of me figure out how to ignore a folder's contents (any kind of content, be it a file or another folder, no matter how deep it is). I'm working on a project that gene...

Git ignore all files in directory expect for specified

My rails app uploads all users photos to a folder /uploads/photos/. I want to ignore everything in this folder in git except for one subfolder /uploads/photos/default/. Is this possible using the .gitignore file? ...

Having problems with .gitignore and Untracked files

Greetings, I have a weird problem with Git and using .gitignore. I have a folder (that has contents) in my structure that is currently not getting tracked by git because it shows up under the Untracked files when I do git status. I add it's path to .gitignore but try git status again and it is still there! Other files/folders, I do t...

.gitignore wildcard not working?

Super quick one. Here is my .gitignore (at the root level of my repo # Makefile stuff LIVE-* .install-post-all When I do this, The LIVE-* bit isn't working: $ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # pm-h8/etc/apache2/conf.d/LIVE-vhost nothing added to ...