git 提交代碼到新的庫,不保留原來的提交歷史記錄


1、git checkout --orphan source 新建一個沒有提交記錄的分支
2、$ git add .
3、$ git commit -m "init"

4、$ git remote -v 查看下git庫地址

5、$ git remote remove origin 刪除原有的git庫

6、$ git remote add origin git地址
7、$ git push origin source
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM