1. Add it to .gitignore projectname/settings.py
  2. Remove the file from git without deleting the file: git rm --cached projectname/settings.py
  3. Commit the change: git commit -m "remove settings.py"