简体   繁体   English

Git的。 在没有克隆它的情况下处理现有存储库

[英]Git. Work on existing repository without cloning it

Im kind of new to Git. 我是Git的新手。 So, last week I pushed my files to Github. 所以,上周我将文件推送到Github。 Then I reinstalled my system (Ubuntu), then I downloaded the files as a Zip archive, extracted them and continued working. 然后我重新安装了我的系统(Ubuntu),然后我将这些文件作为Zip存档下载,提取它们并继续工作。 Now I want to push the updated files but I am not sure how can I do it. 现在我想推送更新的文件,但我不知道我该怎么做。 Plz correct me if I'm wrong, git init would create a new repo. Plz纠正我,如果我错了,git init会创建一个新的repo。 But there is one already. 但已有一个。 And git clone would fork it (as if I wasn't the original creator of the repository. And I find this strange cause Im the only contributor to my small app), anyway, I tried to do that and it will give the error: 并且git clone会分叉它(好像我不是存储库的原始创建者。我发现这个奇怪的原因我是我的小应用程序的唯一贡献者),无论如何,我试图这样做,它会给出错误:

"fatal: destination path already exists and is not an empty directory." “致命:目标路径已存在且不是空目录。”

Thanks in advance for your help. 在此先感谢您的帮助。

git clone will not make a fork but just clone the content of your repository on your local disk. git clone 不会生成fork,只是克隆本地磁盘上的存储库内容。 Here is a manipulation you can do : 这是你可以做的操作:

$ cd your_unzipped_dir/..
$ git clone git@github.com:yourname/yourproject.git
$ cp -r your_unzipped_dir/* yourproject/
$ cd yourproject

Now you can add , commit , and push as usual. 现在,您可以像往常一样addcommitpush

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

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