简体   繁体   English

主要git存储库已删除,我可以从.git目录重新创建它吗?

[英]main git repository got deleted, can I re-create it from a .git directory?

I had a big project with lots of branches and stuff in my git repository. 我有一个很大的项目,在我的git存储库中有很多分支和东西。

the remote git repository got deleted, all I have left is the .git I have from cloning it. 远程git储存库被删除了,剩下的就是克隆后的.git。 can I create for it a main git repository again ? 我可以再次为其创建主git存储库吗?

Yes, you can do that. 是的,你可以这么做。
Just add second remote say origin2 and push to it. 只需添加第二个远程说origin2并推送至它即可。
For example: 例如:

git remote add origin2 https://github.com/user/repo.git
git push origin2 --tags --all

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM