git删除所有历史提交记录,只留下最新的干净代码
生活随笔
收集整理的這篇文章主要介紹了
git删除所有历史提交记录,只留下最新的干净代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
git刪除所有歷史提交記錄,只留下最新的干凈代碼
?
?
1.Checkoutgit checkout --orphan latest_branch2. Add all the filesgit add -A3. Commit the changesgit commit -am "commit message"4. Delete the branchgit branch -D master5.Rename the current branch to mastergit branch -m master6.Finally, force update your repositorygit push -f origin master?
轉載于:https://www.cnblogs.com/leoking01/p/10184514.html
總結
以上是生活随笔為你收集整理的git删除所有历史提交记录,只留下最新的干净代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: leetcode讲解--559. Max
- 下一篇: 【短信插件】短信如何对接74cms_v4