Make git recovery history using current .gitignore

I did not use .gitignore to ignore files such as compiled binaries in my project, so these compiled binaries were transferred to the Git repository. And now I am adding .gitignore to my project. I want to rebuild the entire Git repository, ignoring the files listed in .gitignore, without losing history. How can i do this?

+4
source share
1 answer

Delete these binaries from the current cache if they were added.

git rm --cached abinary

Then your .gitignoreautomatically ignores these binaries.

, , . git filter-branch bfg repo cleaner.

, git push --force, , ( ) , .

+2

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


All Articles