I am merging binaries in git repository and keep on updating the binary. Even though I am replacing the binary, the git repository will store the history so size of the repository scales up which I want to avoid.
To illustrate my scenario:
These are my commits:
f7f9345 Updating the xyz binary to latest version 0987.
f7f4fgw Updating the xyz binary to latest version 0986.
f7f9454 Updating the xyz binary to latest version 0985.
f7f923f Updating the xyz binary to latest version 0984.
ig4254v Updating the xyz binary to latest version 0983.
h545433 Updating the xyz binary to latest version 0982.
g7f934w Updating the xyz binary to latest version 0981.
h7f9344 Updating the xyz binary to latest version 0980.
m7f934f Updating the xyz binary to latest version 0977.
i7f9345 Updating the xyz binary to latest version 0976.
u7f9346 Updating the xyz binary to latest version 0987.
w7f934g Updating the xyz binary to latest version 0927.
f7f934d Updating the xyz binary to latest version 0917.
h7f9344 Updating the xyz binary to latest version 0887.
I am basically replacing xyz binary with new version of itself by deleting the existing binary. But git history would store all the binaries since the first time a binary got created in the repository which will bloat the repository size.
I want to delete the binaries from git history and limit the history to only 5. So when I give git log, I should get only latest 5 commits.
f7f9345 Updating the xyz binary to latest version 0987.
f7f4fgw Updating the xyz binary to latest version 0986.
f7f9454 Updating the xyz binary to latest version 0985.
f7f923f Updating the xyz binary to latest version 0984.
ig4254v Updating the xyz binary to latest version 0983.