Thanks @kazurayam
The issue was indeed with .cache folder. The person that I took this project from did not add this folder to .gitignore, and it was filled in with old junk in the repo.
Additionally the issue occurred when I used Visual Studio Code for branch management, for some reason. Ever since I use just git bash console everything works fine.