简体   繁体   中英

Git. Work on existing repository without cloning it

Im kind of new to Git. So, last week I pushed my files to Github. Then I reinstalled my system (Ubuntu), then I downloaded the files as a Zip archive, extracted them and continued working. 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. 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:

"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. 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.

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