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

后端 未结 15 1699
情书的邮戳
情书的邮戳 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:44

    You can do it by typing the following command lines recursively:

    mkdir temp_dir   //  Create new temporary dicetory named temp_dir
    git clone https://www...........git temp_dir // Clone your git repo inside it
    mv temp_dir/* existing_dir // Move the recently cloned repo content from the temp_dir to your existing_dir
    rm -rf temp_dir // Remove the created temporary directory
    

提交回复
热议问题