user9192656
user9192656

Reputation: 579

Can not make git pull after import

I have a problem with the file which is imported (application in django 1.11). After importing the file, the data is saved to it, its status is modified:

modified: media/import_file.json

Then I want to do a git pull on my code and I can not because the file is modified. I have entries in the .gitignore file, but they do not work:

/www/media/import_file.json
/www/media/*

Upvotes: 0

Views: 154

Answers (1)

priteshbaviskar
priteshbaviskar

Reputation: 2327

The .gitignore is only looked up when we add files to repo. So, if the file was already added to git (using git add), just putting it in gitignore won't work. Once you add the file to .gitignore, you need to exclude it from the repository as well. It can be done using-

git rm --cached /www/media/import_file.json

Please make sure to add the --cached flag. It ensures that the file is removed from git repository only and not the file system.

Upvotes: 3

Related Questions