Reputation: 661
I had a magento setup in which I created a .gitignore file which is like as follows:
######## MAGENTO RELATED FILES AND FOLDERS ######
var/*
media/*
app/etc/local.xml
minified/css/*
minified/css_secure/*
minified/js/*
minified/media/*
later I figured out that due to this rule var
and media
dirs also got ignored and were not part of commit.
So I tried to comment var/*
and media/*
lines, I tried to delete, the .gitignore
file, committed and pushed to remote repo. but nothing works.
Any chance to get them back under tracking? Please note there is only one .gitignore
file.
Many thanks!!
Upvotes: 0
Views: 149
Reputation: 4128
git tracks content; directories are not content, they are structure. What you can do is, drop empty placeholder files in var/
and media/
and track those. That will bring the directory structure under git's supervision.
You can keep the var/*
and media/*
lines in your .gitignore, just add an exception for the placeholder files like
!var/README.md
!media/README.md
Upvotes: 1