Last active
November 16, 2020 21:58
-
-
Save vmiheer/3a2aefb97e2dcf62853cd60f59473b41 to your computer and use it in GitHub Desktop.
Create github private fork
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
function private_clone() { | |
sourceRepo=$2 | |
destOrg=$1 | |
repoName=$(echo $sourceRepo | cut -d/ -f 2) | |
destRepo=$(echo $destOrg/$repoName) | |
gh repo create -y --private $destRepo | |
git clone --bare [email protected]:$sourceRepo\.git | |
cd $repoName\.git | |
git push --mirror [email protected]:$destRepo | |
cd ..; rm -rf $repoName\.git; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use as: