What is the most sane method to keep repository history small?
I understand that storage history is something that is better to keep for vcs and I know that git allows to clone not the full history log but:

 - I afraid GitHub space is limited (main reason)
 - it's auto-commits processing by script
 - I'm interesting only in last 10 or 5 commits in history
 - server space could be limited

For now I found only that tricky way to clean all the history using git rebase

    git checkout --orphan temp $1
    git commit -m "Truncated history"
    git rebase --onto temp $1 origin/master
    git checkout master
    git branch -D temp

But that is as complex as useless, it's easier to create new repository and push files directly there. So need something to keep git repository history small.
What is the most sane method to keep repository history small?
===

I understand that storage history is something that is better to keep for vcs and I know that git allows to clone not the full history log but:

 - I afraid GitHub space is limited (main reason)
 - it's auto-commits processing by script
 - I'm interesting only in last 10 or 5 commits in history
 - server space could be limited

For now I found only that tricky way to clean all the history using git rebase

    git checkout --orphan temp $1
    git commit -m "Truncated history"
    git rebase --onto temp $1 origin/master
    git checkout master
    git branch -D temp

But that is as complex as useless, it's easier to create new repository and push files directly there. So need something to keep git repository history small.