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

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

    Lots of answers already to do it the way that the OP asked. But it worth noting that doing it the opposite way around is far simpler:

    git clone repo-url tmp/
    cp -R working/ tmp/
    

    You now have the desired target state - fresh clone + local-changes.

提交回复
热议问题