title: How to ignore migrations but __init_.py?
body: <p>I've been thinking about this. </p>
  
  <p>See here: <a href="https://stackoverflow.com/questions/28035119/should-i-be-adding-the-django-migration-files-in-the-gitignore-file">Should I be adding the Django migration files in the .gitignore file?</a></p>
  
  <p>I agree with Robert L, it says that we shouldn't commit our migrations.</p>
  
  <p>My questions are:</p>
  
  <p><strong>1) How to ignore all migrations except for the <em>init</em>.py file that is inside the migrations folder?</strong></p>
  
  <p><strong>2) How to remove migrations that were already committed?</strong> </p>
  
  <p>I'm looking to avoid any conflicts between developers.</p>
  
  <p><strong>app structure example:</strong></p>
  
  <pre><code>|_roles
    |__pycache__
       |___init__.cpython-37.pyc
       |_admin.cpython-37.pyc
       |_forms.cpython-37.pyc
       |_models.cpython-37.pyc
       |_urls.cpython-37.pyc
       |_views.cpython-37.pyc
    |_migrations
      |__pycache__
       |___init__.cypthon-37.pyc
       |___0001_initial.cpython-37.pyc
       |___0002_auto_20200111_1307.cpython-37.pyc
       |___0003_auto_20200111_1418.cpython-37.pyc
      |__init_.py
      |_0001_initial.py
      |_0002_auto_20200111_1307.py
      |_0003_auto_20200111_1418.py
     |__init_.py
     |_admin.py
     |_apps.py
     etc..
  </code></pre>
  
  <p><strong>.gitignore</strong>: I'm thinking about:</p>
  
  <pre><code>*./migrations/
  </code></pre>
  
  <p>But this would exclude the whole folder.</p>