1

When I git add/commit and push to my server, everything updates perfectly except for my instance/settings.py file. In VS code it lets me know when something has been modified and needs to be pushed. However, when I save my instance/settings.py file it doesn't show up as needing to be pushed. Then when I try to git commit the file it tells me it is up to date. I have to ssh into my server and edit it manually to change it.

Does anyone have any idea why this happens, is it something to do with the Flask architecture?

EDIT: Here is the result of git blame .gitignore:

^91214a4 (michael 2019-03-30 13:51:08 +1100  1) # Byte-compiled / 
optimized / DLL files
^91214a4 (michael 2019-03-30 13:51:08 +1100  2) __pycache__/
^91214a4 (michael 2019-03-30 13:51:08 +1100  3) *.py[cod]
^91214a4 (michael 2019-03-30 13:51:08 +1100  4) 
^91214a4 (michael 2019-03-30 13:51:08 +1100  5) # C extensions
^91214a4 (michael 2019-03-30 13:51:08 +1100  6) *.so
^91214a4 (michael 2019-03-30 13:51:08 +1100  7) 
^91214a4 (michael 2019-03-30 13:51:08 +1100  8) # Distribution / packaging
^91214a4 (michael 2019-03-30 13:51:08 +1100  9) node_modules/
^91214a4 (michael 2019-03-30 13:51:08 +1100 10) bin/
^91214a4 (michael 2019-03-30 13:51:08 +1100 11) build/manifest.json
^91214a4 (michael 2019-03-30 13:51:08 +1100 12) develop-eggs/
^91214a4 (michael 2019-03-30 13:51:08 +1100 13) dist/
^91214a4 (michael 2019-03-30 13:51:08 +1100 14) eggs/
^91214a4 (michael 2019-03-30 13:51:08 +1100 15) parts/
^91214a4 (michael 2019-03-30 13:51:08 +1100 16) sdist/
^91214a4 (michael 2019-03-30 13:51:08 +1100 17) var/
^91214a4 (michael 2019-03-30 13:51:08 +1100 18) npm-debug.log
^91214a4 (michael 2019-03-30 13:51:08 +1100 19) *.egg-info/
^91214a4 (michael 2019-03-30 13:51:08 +1100 20) .installed.cfg
^91214a4 (michael 2019-03-30 13:51:08 +1100 21) *.egg
^91214a4 (michael 2019-03-30 13:51:08 +1100 22) 
koopmac
  • 936
  • 10
  • 27

1 Answers1

2

Try switching to command-line and check

git check-ignore -v -- instance/settings.py

If the output is not empty, you will see why this file is ignored.

If the output is empty, the file is not ignored, and git status can tell you more about its state.

The OP polymath confirms in the comments:

the command returns .gitignore:52:instance/settings.py instance/settings.py.

The local .gitignore file of the cloned repo does ignore that file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks Von, the command returns `.gitignore:52:instance/settings.py instance/settings.py`. Do you know why it would have been added to my .gitignore file in the first place? – koopmac Apr 27 '19 at 04:53
  • @polymath I understand `local_settings.py` could be ignored (https://stackoverflow.com/a/3719569/6309), but not `settings.py` – VonC Apr 27 '19 at 04:57
  • @polymath Try a `git blame .gitignore`: you will see if that line has been added as part of the history of that file. – VonC Apr 27 '19 at 04:59
  • I've added the result of git blame to my question above, it doesn't show the file being added at any point which is strange. – koopmac Apr 27 '19 at 05:06
  • @polymath you should see a line 52. Maybe this is the wrong .gitignore file. – VonC Apr 27 '19 at 05:07
  • It's the correct .gitignore file, and yeah you're right it is on line 52 I'm just curious now how or why it was added there in the first place. – koopmac Apr 27 '19 at 05:10
  • @polymath You should see the commit on that line: a `git log -p -1 ` should show you more. – VonC Apr 27 '19 at 05:13