- Mingfei Sun
- Created at: 2018-07-23
- Modified at: 2018-07-25
- Create a new branch from current branch
git checkout -b <new_name>
- Checkout to the new branch
- Delete dead files in history
git gc --prune=now --aggressive
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort --numeric-sort --key=2 \
| cut -c 1-12,41- \
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
# under current branch
git merge <new_branch>