Git: how to delete files that are now in gitignore but have been added to the repo before

I have several files that are in the repo as well as in .gitignore.

I would like these files to be deleted from the repo but not deleted from my production server when I do git pull origin master

I tried several solutions, but not a single seam worked, in each of them I delete files from the server when I do pull.

Literature:

How to make Git "forget" about a file that has been tracked but is now located in .gitignore?

Delete directory from remote repository after adding them to .gitignore

How to delete files specified in .gitignore, but still in the repository?

+4
source share
2

git filter-branch, , .

: https://help.github.com/articles/remove-sensitive-data/

, , .

- , , :)

+1

AFAIK, " , ".

, , .

- :

cp file file.prod
git pull
mv file.prod file
+3

Source: https://habr.com/ru/post/1628128/


All Articles