Creating a Shared Repl

At a high level, the process to create a shared repl is as follows:

  1. One of the pair partners creates a new repl and pushes it to GitHub,

  2. That person then invites the other partner as a collaborator in both Repl.it and GitHub.

It doesn't matter who creates the repl—it can be the one listed first, or the one listed second in the pair name. For this explanation, we will refer to the partner who creates the repl as "student A" and the one who gets invited to collaborate as "student B". However, it doesn't matter who assumes which role. You will be following the same process for future labs and we recommend that you alternate who creates the project and who is invited as the collaborator.

Step 0: Choose the right name

If your pair consists of Alice and Bob, there are two ways your names could be listed: Alice-Bob or Bob-Alice.

To make things easier to manage, we've chosen a specific order for your pair (one that puts your names in alphabetical order), and published it on the pair partner's spreadsheet in the column Pair Name . This matches the order for names on the discord channels.

Please make a note of the order for your pair now, and use it any time you are are creating a repo for your pair.

Step 1: Student A -- Create a new Repl

Whoever takes on the role of student A, should log into Repl.it and recreate a new repl (as explained in lab 0). The other student (student B) should not create a repl.

As the name of the repl, use spis22-labXX-Name1-Name2 where,

    • labXX is the lab name (as a 2 digit number), e.g., lab01, lab02, etc.

    • Name1 is the first pair partner’s preferred first name

    • Name2 is the second pair partner’s preferred first name

The Pair Name column in the SPIS 2022 Pairs List corresponds to this First-Second part. An example repl name for the fictitious SPIS students Alex Triton and Chris La Jolla for lab 1 would be: spis22-lab01-Alex-Chris.

Regardless of who is student A and who is student B, please name the repo according to the pair order that is listed in the Pair Name column. in this spreadsheet. That makes it MUCH easier for us to find your work!

Also, if your name has a last initial (e.g. if there are two student's named Alex, or two students named Chris), please include this, with a hyphen, not a space—e.g. spis22-lab01-Alex-F-Chris-W just as shown on the SPIS 2022 Pairs List .

Step 2: Student A -- Share the Repl

Now, student A who created the new repl in step 1 should share this repl with their pair-partner. Click on the “Invite” button in the top right corner. Enter the UCSD email address of your partner and click “Invite”. The Repl.it user name of your partner should now appear in the window, with the "(can edit)" qualifier. You can now close this window.

Step 3: Student B -- Accept the Shared Repl

Student B, whose email address was entered in the previous step as being the recipient of the shared repl, will get a notification. This can be found under the Repl.it main menu (if it is not visible, you can find it under the three horizontal bars in the top left), where you see the bell icon. It should display a red circle with a number (even if you don't see the red circle, just click the bell icon). If you click it, it will list your notifications. Click on the > arrow for the one you want to access and accept.

You should now both have access to the same repl. You can test this out by having one student type some Python code, and the changes should be visible by the other student almost instantaneously. This is a way to truly create code together.

Step 4: Student A -- Push to GitHub to Create a Repo

Student A, the one who create the repl initially, should now push it to GitHub.

The procedure is the same as explained in lab 0, step 6.

You can check on GitHub that a new repo was indeed created there (in the GitHub of student A, not yet in that of student B).

Step 5: Student A -- Invite your Pair Partner as a Collaborator on GitHub

Student A, who created the GitHub repo by pushing it from Repl.it in the previous step, needs to invite their pair-partner as a collaborator for that repo. This is done on github.com. Go to your repo on GitHub and click on the gear icon called “Settings”. In the left pane, click on “Manage Access” (it may prompt you for your password again). Next, click the green “Invite teams or people” button and in the search field enter the GitHub ID of your partner. Select the name once it appears (make sure it is correct so you are not sharing your repo with a complete stranger). Then, scroll down (in the list under “choose a role”), select “Admin” and click on the green button.

Step 6: Student B -- Verify Access to the Shared Repo

Both pair partners should now be able to make changes to the same repl and push changes to the same GitHub repo. You can try this out. Student B can make a change in the repl and then push the change to GitHub.

Note: When you are working on code together and you want to push a change to Github, only one of the partners need to do this. The repl is a shared document (i.e., there is only one single document you both have access to) and the same is true for the GitHub repo. So it doesn't matter who actually makes changes and who pushes them. You can also see changes your partner made in terms of the commit history on Repl.it, but you need to refresh the page there first.

Note: When you come back to Repl.it to resume a project you were working on before, you can find your repl under the main menu under “My Repls”. If you don’t see this menu, you can make it appear by clicking the main menu icon (the three horizontal bars in the top left corner). If your pair-partner is the one who originally created the repl and then shared it with you, you can find those repls under “Multiplayer repls”.

Summary

The procedure to create a shared repl is summarized below. You will use it for all the subsequent labs:

  • Partner A

    1. Create a new repl in the appropriate folder

    2. Push the new repl to GitHub (which creates a new repo there)

    3. Share the repl with Partner B

    4. Add Partner B on GitHub as a collaborator for the repo

  • Partner B

    1. Accept the shared repl notification

You can change which of you is Partner A and which is Partner B in this process. We recommend you alternate so everyone experiences the procedure from both sides.

Also, remember that no matter which role you assumed in this repl sharing process, this is independent of the roles of driver and navigator, which relate to how you work together when writing the code. You should switch driver-navigator roles frequently throughout the lab.