I have a repo on github that contains a web application that's deployed to two different domains. The application has slight logic forks here and there to behave differently depending on which domain it's deployed to.
It's come to the point to where I want to split it into two separate repos, one for each domain.
Github won't let me fork it into the same organization. Searching for "git duplicate repo" suggests I should bare clone and mirror push it, but that seems to be for keeping both repos in sync, which I don't want to do.
What's the best way to go about this? I'd like to preserve the old commit history in the new copy if possible.
git clone --bare
andgit push --mirror
options are exactly what you want. This does not keep both repos in sync. But it does preserve everything, including all branches, tags, etc. Just do this in a temporary directory to make a copy. Then clone the new copy directly from your remote in your project directory. – Brachyuran