Last active
February 9, 2023 01:11
-
-
Save BlazerYoo/751939271746430f6a78f2172cada0c7 to your computer and use it in GitHub Desktop.
COS217 auto repo env setup [Source: https://www.cs.princeton.edu/courses/archive/fall22/cos217/precepts/01introlinux/GitGitHubPrimer.pdf]
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
echo " __ __ __ __ ___ __ __ __ __ __ _____ __ " | |
echo "/ / \(_ _) /| / |__)|_ |__)/ \ (_ |_ | / \|__) " | |
echo "\__\__/__) /__ | / | \ |__| \__/ __)|__ | \__/| " | |
echo | |
echo | |
# $1 - github username | |
# $2 - name of COS217 template repo | |
# $3 - name of your private github repo | |
echo "Creating private repo '$3' based on '$2' for '$1'..." | |
echo | |
echo | |
# Bare clone template repo | |
git clone --bare https://github.com/COS217/$2 | |
# Create private repo on github | |
curl -u $1 https://api.github.com/user/repos -d '{"name":"'"$3"'", "private":"true"}' | |
# Push template repo to your private repo | |
cd $2.git | |
git push --mirror https://github.com/$1/$3 | |
# Clone private repo local machine | |
cd .. | |
git clone https://github.com/$1/$3 | |
echo | |
echo | |
echo "Run cd $3 and get started." | |
echo | |
echo | |
echo "Created by Boaz" | |
echo "You're welcome." | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment