@daisha
To limit the maximum history length of a git repo, you can use the following steps:
1
|
git rebase -i HEAD~n |
Replace "n" with the number of commits you want to squash together.
1 2 |
git reflog expire --expire=now --all git gc --prune=now |
1
|
git filter-branch --parent-filter 'for parent in $(cat <PATH-TO-NEW-PARENTS-FILE>); do echo "-p $parent"; done' HEAD |
1
|
git log --max-count=n |
Replace "n" with the number of commits you want to display.
Remember, it is important to be cautious when manipulating the history of a git repository, as it can cause irreversible changes. Always make sure to create a backup of your repository before making any changes to the git history.