Git will record each different version of the file. Even if you only change one line of a file, git will generate a brand-new blob object to store the new file contents. Git gc packages or Git will automatically perform a packaging process every time git push, merge blob objects into a package file, and generate an index file, which contains the offset information of each blob object in the package file. Incremental coding scheme is used in the packaging process, and only the differences between different versions of blob objects are saved, which will slow down the growth of the warehouse. But the whole is still a rising process.
The core of the first method is to clean up large files or files that are no longer needed (hereinafter referred to as redundant files) and their submission records. You must think twice about the following operations, and you will really delete the file!
The second method is more violent, directly deleting the history of the whole warehouse, and achieving the goal of slimming the git warehouse.