I connected a second github account to import a repo to start a new repl, but after I auth with my other github account, it does not show up in the dropdown.
@kody-replit any pointers here? I want to see about importing a real/active project into Replit. Being able to do this might justify a Teams upgrade. But I need to be able to import it first.
You should only be able to connect a single github account, then the dropdown is the personal vs. organizations associated with that github account. The “Add GitHub Account” there is bad copy, will get it updated to “Switch Github Connection” or something, let me ask design. Thanks for the feedback!
To do it initially, I’d just break the github account connection then reconnect to the correct one. Will update with new info or if we ship a quick fix.
Helpful! My preference would be for supporting the connection of multiple individual github accounts. I have several (for W2 work, for personal projects, for 1099 projects, for my own startup collaborations), so being able to import into a single Replit user account would be ideal. However, I suppose the hack would be to create a new Replit account for import my other individual github account.
Yeah they’re associated at the email level now so a little tricky, couple engineers looking into some options. We’ve got hack week next week so someone might just ship it if they come up with a nice solution
I was able to remote in with cursor and use cursor agent to connect it to a repo owned by an ORG. But I believe it has the same user for my personal and org github user.
So that worked. If I didn’t have the same account for both, I probably could have used an SSH key on the correct github account, and add that to the repl.
I do something similar. But to get around the issue I use shallow export into a temp folder.
You can use HTTPs or SSH authentication to make it work - this way it doesn’t mess with the Replit Github + Replit git integration.
Here is a sample of the script:
Step 1: Create a temporary directory outside the current checkout
TEMP_DIR=$(mktemp -d -t $RANDOM_PREFIX)
echo “Using temporary directory: $TEMP_DIR”
Step 2: Clone the repository shallowly and enable sparse checkout
echo “Cloning repository (shallow)…”
git clone --depth=1 --filter=blob:none --sparse “$SOURCE_REPO” “$TEMP_DIR”
Step 3: Sparse checkout the specific folder
cd “$TEMP_DIR”
git sparse-checkout init --cone
git sparse-checkout set “$SOURCE_FOLDER”
Step 4: Copy the files to the target folder
echo “Copying files to $TARGET_PATH…”
cd -
mkdir -p “$TARGET_PATH”
cp -r “$TEMP_DIR/$SOURCE_FOLDER/”* “$TARGET_PATH/”
Step 5: Clean up the temporary directory
echo “Cleaning up temporary directory…”
rm -rf “$TEMP_DIR”
Step 6: Commit the changes to the repository
echo “Committing updated files to the repository…”
git add “$TARGET_PATH”