简体   繁体   English

如何在Github上恢复已删除的存储库并保留所有提交历史记录?

[英]How to restore deleted repository on Github and keep all commit history?

I have a local copy of an old repo that was deleted on Github already. 我有一个旧仓库的本地副本,该副本已在Github上删除。

This local copy was just a simple clone (without -bare or -mirror) made by: 此本地副本只是由以下人员创建的简单克隆(不带-bare或-mirror):

git clone https://github.com/olduser/oldrepo.git

This old Github user account I already lost control. 这个旧的Github用户帐户我已经失去控制了。

How to upload this deleted repo back to Github, while keeping all commit history? 如何在保留所有提交历史记录的同时将已删除的仓库回传到Github?

What I want is similar to restore it as if it were forked, and to a new location: 我想要的是类似于将其还原为分叉并将其还原到新位置的方法:

https://github.com/newuser/newrepo.git

Is it possible? 可能吗?

一个git remote set-url origin https://github.com/newuser/newrepo.git然后是一个git push origin应该可以做到。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在github上恢复提交历史? - How to restore commit history on github? 如何从存储库的所有分支检查github提交历史记录? - How to check github commit history from all branches of a repository? 如何在没有提交历史的 git 存储库中恢复被强制删除的文件? - How to recover a forcibly deleted file in a git repository with NO commit history? 有什么方法可以恢复已使用本地保存的代码和提交历史记录删除的 GitHub 存储库? - Is there any way to restore a GitHub repo that has been deleted with the code and commit history saved locally? 如何将代码从新的本地文件夹推送到现有 Github 存储库的主分支并保留提交历史? - How do I push code from a new local folder to an existing Github repository's main branch and keep commit history? 如何在Web浏览器中删除github存储库提交历史记录 - How to delete github repository commit history in web browser 如何还原github仓库 - How to restore github repository 我如何只保留git仓库的1个提交历史记录? - How can I keep git repository only 1 commit history? 如何恢复 GitHub 上已删除的文件 - How to restore deleted files on GitHub 如果旧的存储库不在线,如何将所有提交历史记录保存在旧的存储库中,并将其内容移动到新的存储库中? - 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?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM