22 lines
445 B
Markdown
22 lines
445 B
Markdown
# Trunch gh-pages branch
|
|
|
|
The branch is going to expand as every commit will trigger new rebuild all websites static files.
|
|
|
|
We need to trunc 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
|
|
```
|
|
|
|
2. 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
|
|
``` |