git只保留最新代码,删除历史记录
git cat-file commit master^X | sed -e '/^parent/ d' > tmpfile git rebase --onto $(git hash-object -t commit -w tmpfile) master rm -f tmpfile
git cat-file commit master^X | sed -e '/^parent/ d' > tmpfile git rebase --onto $(git hash-object -t commit -w tmpfile) master rm -f tmpfile