0

For some reason my Sqlite3 database isn't being ignored.

After committing all code changes from my local machine to GH, I git pulled them into my production machine only to find the merge conflict error AGAIN with sqlite3.

I ran

git stash
git pull
git stash apply --index

only to get

warning: Cannot merge binary files: db.sqlite3 (Updated upstream vs. Stashed changes)
Auto-merging settings/base.py
Auto-merging db.sqlite3
CONFLICT (content): Merge conflict in db.sqlite3

When I go to my domain name, it looks as though the master branch changed (re styling etc) hasn't even been pulled, only the new sqlite database entries (such as my text profiles etc)!

I'm really confused at how to properly do this, I've followed a load of tutorials and still can't get this fixed.

My .gitignore

*.pyc
*.sqlite3
db.sqlite3
/settings/local

Can someone please help me? Yes I've also ran git rm --cached db.sqlite3 on both local and production machine.

Trilla
  • 943
  • 2
  • 15
  • 31
  • And after you did `git rm`, did you commit that change? – Lasse V. Karlsen Mar 11 '19 at 13:32
  • You shouldn't be doing `git rm --cached` in production. Do it _locally_, then _commit that change_. Back your production database file up, then pull your code there, overwriting your production database. Replace the now untracked database file from your backup. All of the answers you'll see involving `update-index` aren't what you want. That's often an antipattern. – ChrisGPT was on strike Mar 11 '19 at 13:57
  • @LasseVågsætherKarlsen -_____- thank you – Trilla Mar 11 '19 at 14:08
  • @Chris Got it...many many thanks! – Trilla Mar 11 '19 at 14:09

0 Answers0