in my Django project,i have already .gitignore file in root as well in django project but when i fire git status or git add . It adding all __pycache__ db.sqlite3 in repository. i need to remove those two things from my project. please help.!
I tried all things like
*.sqlite3,mom/*.sqlite3,mom/db.sqlite3anddb.sqlite3in my both.gitignorefile respectively. But anything not work in any directory.
here is my main git ignore file .gitignore
media
*.sqlite3
**/__pycache__/**
*.pyc
here is my another git ignore file .gitignore
media
db.sqlite3
**/__pycache__/**
*.pyc
I also tried many possibilities from online resources but anything not working
file structure
MOM-PROJECT(local Repo)
|
├───MOM (main project)
| ├───media
| │ └───media
| ├───MOM
| │ ├───migrations
| │ └───templatetags
| ├───userprofile
| │ └───migrations
| │ └───__pycache__
| ├───templates
| │ ├───MOM
| │ ├───userprofile
| │ └───base.html
| ├───manage.py
| ├───requirements.txt
| ├───db.sqlite3
| └───.gitignore [another created after main]
|
├───README.md
├───.git
└───.gitignore [Main]
list adding file of git add command
modified: .gitignore
new file: mom/.gitignore
new file: mom/db.sqlite3
modified: mom/meeting/admin.py
modified: mom/meeting/views.py
modified: mom/static/js/meetingtext.js
...
Umm Actually first i created .gitignore file in at main folder where .git folder(in project) exist. my media folder automatically removed and that worked fine. but when i added mom/db.sqlite3 or *.sqlite3 in main .gitignore it's not ignoring therefore i created another .gitignore file inside my project folder where db.sqlite3 is exist. but that also not ignoring my db.sqlite3 file
please suggest me what i need to do. please don't suggest me to use Smart-Git or any other GUI option. right now i m learning phase so i need all thing over commandline
new file, rungit rm --cachedto remove them from the index—you've added them to the index (though not yet committed, luckily), so now putting the names into.gitignoredoes not take them out again.