How to ignore a folder when you have made uploads?

0

I'm with a project in Django where I need git to stop looking at the pycache folders and migrations of the different applications I have.

I have modified the gitignore to add all the routes I want to ignore but apparently if you have already made a upload it does not attend to that file and it always reflects me the changes to upload them.

I also have a folder called media in which the images that users upload are added.

Right now I have the gitignore file in the following way:

GITIGNORE

manage.py
media/*
usuarios/migrations/*
usuarios/__pycache__/*
productos/migrations/*
productos/__pycache__/*
backend/migrations/*
backend/__pycache__/*
frontend/migrations/*
frontend/__pycache__/*
intranet/migrations/*
intranet/__pycache__/*
src/settings-prod.py
src/__pycache__/*
emojipy/__pycache__/*
api/__pycache__/*
src/aws/__pycache__/*
emojipy/__pycache__/*

I tried the git update-index --assume-unchanged carpeta/__pycache__/* command but in some folders it keeps showing me that there are changes.

    
asked by F Delgado 15.10.2018 в 13:38
source

1 answer

2

What you need to do is remove those files from the cache of git . To do it you can use this command:

git rm --cached tu_archivo_o_directorio
    
answered by 15.10.2018 / 17:52
source