아주 간단합니다. Git은 디렉토리 이름이 무엇인지 신경 쓰지 않습니다. 안에있는 것만 신경 쓰죠. 따라서 간단하게 다음을 수행 할 수 있습니다.
# copy the directory into newrepo dir that exists already (else create it)
$ cp -r gitrepo1 newrepo
# remove .git from old repo to delete all history and anything git from it
$ rm -rf gitrepo1/.git
저장소가 크고 기록이 긴 경우 복사본이 상당히 비쌉니다. 쉽게 피할 수 있습니다.
# move the directory instead
$ mv gitrepo1 newrepo
# make a copy of the latest version
# Either:
$ mkdir gitrepo1; cp -r newrepo/* gitrepo1/ # doesn't copy .gitignore (and other hidden files)
# Or:
$ git clone --depth 1 newrepo gitrepo1; rm -rf gitrepo1/.git
# Or (look further here: http://stackoverflow.com/q/1209999/912144)
$ git archive --format=tar --remote=<repository URL> HEAD | tar xf -
를 만든 후에는 원하는 경우 안에 newrepo넣을 gitrepo1수 있습니다 newrepo. 절차를 변경하지 않고 gitrepo1다시 작성하는 경로 만 변경합니다 .
mv girepo1 newrepo??