Last active
May 27, 2022 15:19
-
-
Save BenMcLean/914452795ffc1cb2ea7664a21c65ce98 to your computer and use it in GitHub Desktop.
Batch file to transfer a Git repository to a different remote repo
This file contains hidden or 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
cd %~dp0 | |
for %%g in ("%1") do set "Folder=%%~ng" | |
mkdir %Folder% | |
cd %Folder% | |
git clone --mirror %1 | |
cd %Folder%.git | |
git config --unset core.bare | |
git remote remove origin | |
git remote add origin %2 | |
git push -u origin --all | |
git push origin --tags | |
cd ../.. | |
rmdir /s /q %Folder% | |
@PAUSE |
This file contains hidden or 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
cd %~dp0 | |
for %%g in ("%1") do set "Folder=%%~ng" | |
mkdir %Folder% | |
cd %Folder% | |
git svn clone %1 | |
cd %Folder% | |
git remote add origin %2 | |
git push -u origin --all | |
git push origin --tags | |
cd ../.. | |
rmdir /s /q %Folder% | |
@PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment