简体   繁体   English

来自克隆的Git克隆

[英]Git clone from clone

I have cloned a git repository from a server, and then I have cloned a second copy from my local copy. 我已经从服务器克隆了一个git存储库,然后又从本地副本中克隆了第二个副本。

Unfortunately I have deleted the first copy (from the server), and I have only the second copy. 不幸的是,我已经删除了第一份副本(从服务器),而我只有第二份副本。 I would like to push this second copy to the server now. 我现在想将第二个副本推送到服务器。 With a simple "git push" I got the message "Already up-to-date.", but the server is not updated. 通过简单的“ git push”,我收到消息“已经是最新的。”,但是服务器未更新。

I was thinking of deleting all the .git folders, cloning a new copy from the server, and then put my local copy into it. 我正在考虑删除所有.git文件夹,从服务器克隆一个新副本,然后将本地副本放入其中。 But this way I'll loose all of my logs. 但是这样一来,我将丢失所有日志。

Is there a more elegant way of doing this? 有没有更优雅的方式做到这一点?

Thanks 谢谢

尝试这个

git remote set-url origin https://github.com/username/yourrepo

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

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