Ignore files in commits already made and pushed


I want to ignore a file in commits that I already made and push to github, because when I see commit by commit from start to end I am seeing the modifications that were made in some files and I do not want to have to see this. Is there any way to skip-ignore these files when viewing the commit history?

asked by Daniel Hernández 01.07.2016 в 00:32

2 answers


If you still need it, I'll give you the solution that worked for me:

git update-index --assume-unchanged '<file>'

With this line you indicate which file you want to ignore, the same as in the place of passing a file, you pass the path of an entire folder.

If you want to stop ignoring:

git update-index --no-asume-unchaged '<file>'

You can get a list of the files that have been ignored by the -assume-unchanged:

git ls-files -v|grep '^[a-z]'
answered by 25.08.2016 в 20:41

You should add to the .gitignore file, although if the file is already being versioned by Git, adding that file to .gitignore will not cause Git to stop observing it. In this case you will need to execute git rm --cached to keep the file and then ignore it. You can find more information at the following link Ignore git files

answered by 01.07.2016 в 04:01