Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 524 Bytes

Truncate-branch.md

File metadata and controls

28 lines (19 loc) · 524 Bytes

Truncate gh-pages branch

The branch is going to expand as every commit will trigger new rebuild all websites static files.

We need to Truncate it periodically.

  1. Check out to gh-pages and find the latest commit ID.
git checkout gh-pages
git pull <upstream> gh-pages
git log
  1. Assume the commit ID is COMMIT_ID
git checkout --orphan temp COMMIT_ID
git commit -m "Truncate history"
git rebase --onto temp COMMIT_ID gh-pages
  1. Force push the Truncated branch.
git push origin gh-pages -f