简体   繁体   中英

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.

the remote git repository got deleted, all I have left is the .git I have from cloning it. can I create for it a main git repository again ?

Yes, you can do that.
Just add second remote say origin2 and push to it.
For example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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