Exact `svn export` equivalent command for git?

前端 未结 8 986
花落未央
花落未央 2021-02-06 04:53

There is no exact svn export equivalent command for git? Really?

Beware: this is not a duplicate question. That is, I already know and have

8条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 05:11

    The question "how can I do a svn-style 'export' with git?" is like asking "How can I change the tires on my basketball?". You can't, but that's not the basketball's fault. Yes it is rubber and full of air, but the similarity ends there.

    You only need "export" with svn because it pollutes every single subdirectory with a .svn directory. Git doesn't do that, so you really don't need it. A clone IS an export, just with one directory at the root dir that all the repository business lives in.

    The easiest thing is to clone the repo and then just delete the .git directory from the top level of the repo. Do that, and it's not a repo anymore, it's just a stand-alone directory of files.

    Or, you know, ignore git all together and just use the files you cloned down. That works too.

提交回复
热议问题