Skip to content

Instantly share code, notes, and snippets.

@xyzzy529
Created April 6, 2017 04:40
Show Gist options
  • Save xyzzy529/9325c015837a42b1842322166a8a0d66 to your computer and use it in GitHub Desktop.
Save xyzzy529/9325c015837a42b1842322166a8a0d66 to your computer and use it in GitHub Desktop.
Clone Wiki from Github Origin to My Github, Windows Batch
@echo off
REM %= Clone the $1 GitHub wiki into my repo =%
REM 1. Fork the repo on github normally (1 click)
REM 1.1 Click on Wiki tab in your repo and Create/Save blank page
REM 2. Copy repo URL from original, paste on command line.
REM 2.1 Copy repo URL from your Forked repo
REM 3. run this batch file with
REM @param1 = https://github.com/Sriep/screeps.git
REM @param2 = https://github.com/xyzzy529/screeps-1.git
REM
echo Clone Wiki %1
echo To my Wiki %2
set FromGit=%1
set FromWiki=%FromGit:.git=.wiki.git%
set ToGit=%2
set ToWiki=%ToGit:.git=.wiki.git%
echo FromWiki=%FromWiki%
echo ToWiki=%ToWiki%
git clone %FromWiki% tempWiki
cd tempWiki
git remote add wikiClone %ToWiki%
git push -f wikiClone master
cd ..
rm -rf tempWiki
dir
REM Everything should be gone except this batch file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment