github删除远程分支提交历史

github 代码提交多了以后 会有很多历史记录,这些历史记录大多没有重要信息切这些历史纪录中可能会包含项目里密码等敏感信息,在网上找了很久,找到一下方法,亲测有效,使你的git仓库成为一个全新的仓库,并保持代码不变。
1.Checkout
1  | git checkout --orphan latest_branch  | 
2.add all the files
1  | git add .  | 
3.Commit the changes
1  | git commit -am 'commit'  | 
4.Delete the branch
1  | git branch -D master  | 
5.Rename the current branch to master
1  | git branch -m master  | 
6.Finally, force update your repository
1  | git push -f origin master  | 
参考地址:stackoverflow
- 本文标题:github删除远程分支提交历史
 - 创建时间:2017-08-30 23:00:09
 - 本文链接:posts/cd78.html
 - 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!