1

I am writing a plugin for magento and have an issue with my gitignore file

I tried to make it like:

/*
!app/code/community/MyAwesomePlugin

wich doesnt work. it just ignores all my files. But if I rewrite it to:

/*
!/app
/app/code/*
!/app/code/community
/app/code/community/*
!app/code/community/MyAwesomePlugin

the gitignore file works fine.

note also that if I do /app/code/ instead of /app/code/* it will have no effects on the gitignore rules.

What is happening here and why can't I simply exclude all and specify a few files to include?

Ben
  • 13,297
  • 4
  • 47
  • 68

2 Answers2

0

I believe the reason why "MyAwesomePlugin" is ignored in the first version is due to git never reaching it. This is because it doesn't go any deeper once it's ignored "app". So in the second version you're continually informing git of directories it's allowed to peer into and eventually it reaches "MyAwesomePlugin"

This post and it's answers give some examples: Make .gitignore ignore everything except a few files

Community
  • 1
  • 1
ccraig
  • 931
  • 1
  • 6
  • 7
-2

It should be a * rather than /*

Make .gitignore ignore everything except a few files

Another option would be to use an existing file.

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
  • i'll accept this answer. the existing file works great. I guess git ignore doesn't work like i want it to. – Ben May 21 '14 at 03:26