Created
July 18, 2020 17:10
-
-
Save kbrafford/bba81d2278cdf9afd7bd185f40e3a2be to your computer and use it in GitHub Desktop.
How to copy a complete git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What I asked <<origin company>> to give us: | |
In order to clone the repositories and get the branches please have them follow | |
this procedure on each of the repos: | |
# Let's mirror the <<reponame>> repo: | |
git clone --mirror git@github.com/<<origin company>>/path/to/<<reponame>>.git <<reponame>>/.git | |
For each reponame.git provided: | |
mkdir reponame | |
move reponame.git reponame\.git | |
cd reponame\.git | |
git config --local --bool core.bare false | |
cd .. | |
git checkout master | |
cd .. | |
create reponame on bitbucket, no readme | |
git remote add bitbucket https://<<userid>>@bitbucket.org/<<newco>>/reponame.git | |
git push --all bitbucket | |
git push --tags bitbucket | |
git remote set-url origin https://<<userid>>@bitbucket.org/<<newco>>/<<reponame>>.git | |
At this point, the repo you've just processed should be ready for people to | |
clone and start working with. People who clone this should see no <<origin company>> cruft | |
in the basic mechanism. Internal submodules will still need to be dealt with. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment