删除历史记录

1
rm -rf .git

从当前内容初始化、

1
2
3
git init
git add .
git commit -m "初始化提交"

推送到远程仓库,并覆盖历史数据

1
2
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
git push -u --force origin master

来源:https://gist.github.com/stephenhardy/5470814