Created
February 27, 2025 21:34
-
-
Save hughdbrown/6bc69639bfcc9f69524bc2947bb3f97c to your computer and use it in GitHub Desktop.
Setup AIE5 with upstream/main and origin/main
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
#!/bin/sh | |
set -eux -o pipefail | |
export GIT_USER=hughdbrown | |
export GIT_REPO_NAME_USER=AIE5 # What the user is going to call the repo | |
export GIT_REPO_NAME_AI_MAKER=AIE5 # What the repo is already called by AI_MAKER | |
mkdir -p ~/workspace/${GIT_USER}/maven.com/${GIT_REPO_NAME_USER} | |
cd ~/workspace/${GIT_USER}/maven.com/${GIT_REPO_NAME_USER} | |
# Make git repo | |
git init . | |
# git-remote-ify the AI-Maker-Space repo | |
git remote add upstream [email protected]:AI-Maker-Space/${GIT_REPO_NAME_USER}.git | |
git remote -v | |
# origin [email protected]:${GIT_USER}/${GIT_REPO_NAME_USER}.git (fetch) | |
# origin [email protected]:${GIT_USER}/${GIT_REPO_NAME_USER}.git (push) | |
# upstream [email protected]:AI-Maker-Space/${GIT_REPO_NAME_AI_MAKER}.git (fetch) | |
# upstream [email protected]:AI-Maker-Space/${GIT_REPO_NAME_AI_MAKER}.git (push) | |
# Pull repo from upstream | |
git pull upstream main --allow-unrelated-histories | |
git branch -M main | |
git remote add origin [email protected]:${GIT_USER}/${GIT_REPO_NAME_USER}.git | |
git push -u origin main | |
git push --set-upstream origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Life saver!