jeudi 22 septembre 2016

Continuous file corruptions multiple GIT repositories containing Django Projects

I have this very frustrating and weird problem regarding two Django Projects, which are in 2 separate GIT repositories.

Let me define project 1 as A and project 2 as B.

A has a homepage, with a connecting home.css file. I have checked the git repository for the contents of this file, overwriting my local copy, and copy pasted the raw contents of this file to home.css -> the homepage displays fine. Now, whenever I quit the Django processes and the virtual environment associated with it, and commit everything on git, and run the project again, the home.css file is suddenly corrupted. The page now looks like this: wrong home page

If I delete the home.css file from the directory and run the following commands:

git fetch origin master
git reset --hard FETCH_HEAD

The project runs fine again (again the screenshot of the correct markup now): enter image description here

The really fun thing is, is that this happens with projects B AND A at the same time. So whenever A is screwed up, B is screwed up. And to add to my confusion: on another computer, with the same repositories, the files are also being changed leading to the corruption of the stylesheet.

What is the culprit? What's going on? The files in the online git repository are correct, because if I paste the raw contents into home.html it works properly again. But after some time, it is messed up. Could it be because of two virtual environments that I'm using for the two projects? Could it be encoding? Could it be a git issue? I'm lost. It's really counterproductive to have this happening every time. There are only 4 files in the two projects that have this error, called home.css (2x) and a base.css and an about.css, so it also shouldn't be name confusion. Moving the repository from Bitbucket to Gitlab also didn't solve the issue. The really strange thing for me is that it happens simultaneously on two machines, so that leads me to think that the issue is not machine dependent. The corruptions always occur on the same lines in the file.

I really hope you guys can help me out.




Aucun commentaire:

Enregistrer un commentaire