What's the best practice to “git clone” into an existing folder?

后端 未结 15 1733
情书的邮戳
情书的邮戳 2020-11-28 17:19

I have a working copy of the project, without any source control meta data. Now, I\'d like to do the equivalent of git-clone into this folder, and keep my local changes.

15条回答
  •  执念已碎
    2020-11-28 17:51

    Usually I will clone the initial repository first, and then move everything in the existing folder to the initial repository. It works every time.

    The advantage of this method is that you won't missing anything of the initial repository including README or .gitignore.

    You can also use the command below to finish the steps:

    $ git clone https://github.com/your_repo.git && mv existing_folder/* your_repo
    

提交回复
热议问题