簡體   English   中英

如果舊的存儲庫不在線,如何將所有提交歷史記錄保存在舊的存儲庫中,並將其內容移動到新的存儲庫中?

[英]How to keep all commit history in an old repo and move its content into a new one if the old repository doesn't exist online?

情況是我有一個存儲庫的本地副本,該副本的git日志中包含所有提交歷史記錄。 這是我上學期使用的課程資料庫,現在,講師已經在線清理了該資料庫-因此它僅存在於我的計算機上。

我希望保留所有提交歷史記錄並將其內容移至新的存儲庫。 但是,當我嘗試遠程推送時,Git引發了無法從遠程存儲庫讀取的錯誤。

在這種情況下,我該如何保存git日志並將所有內容移至新創建的倉庫中?

提前謝謝了!

您需要將存儲庫的來源更改為新位置: https : //www.ethode.com/blog/git-change-remote-origin

這樣,包括git日志在內的所有內容都將被推送到新位置。

$ git remote rm origin
$ git remote add origin git@github.com:username/repositoryName.git
$ git config master.remote origin
$ git config master.merge refs/heads/master

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM