Çok basit. Git, dizininin adının ne olduğunu umursamıyor. Sadece içinde ne olduğu umurunda. Böylece şunları yapabilirsiniz:
# 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
Depo büyükse ve uzun bir geçmişe sahipse, kopyanın oldukça pahalı olduğunu unutmayın. Bunu da kolayca önleyebilirsiniz:
# 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 -
Bir kez oluşturduğunuzda newrepo, koyacağınız hedef gitrepo1her yerde, hatta newrepoisterseniz içeride olabilir. Prosedürü değiştirmez, sadece yazdığınız yolu değiştirir gitrepo1.
mv girepo1 newrepo??