Assignment #6: Remote Repository Setup

In your earlier work, you cloned repositories from GitHub, pushed and pulled content from the site, and collaborated with a partner on a shared repo. However, you often performed each these actions separately from the others.

For this assignment, you will start a project from scratch. Besides making a cool web application, you will also refine all of your version control skills!

The sections below walk you through the setup for your project. After your local and remote repositories are linked and ready to go, return to the main Assignment 6 page.

Create a New Local Repository

Your first step is to create a local project directory. This stores a copy of your code on your personal device.

  1. Launch Visual Studio Code and use the File menu to open your local_practice folder.

  2. In the file tree, create a new directory for your game project. Be sure to give the folder a descriptive name! Also, make sure the new folder is NOT buried inside of a different project.

  3. From the File menu, open your game folder. In the terminal, run git init to initialize the directory for version control.

  4. Use the tools in VS Code to create a file tree that looks like this:

    Starting file tree showing static/style.css, templates/index.html, and main.py.

    The file tree contains two folders (static and templates) plus three code files.

    You don’t need any code in main.py, index.html, or style.css yet.

  5. Use the terminal to create a new virtual environment for your project, then install Flask. If you need a reminder for how to do this, review the guidelines in the Cookies & Sessions chapter.

  6. Add a .gitignore file and paste in the usual code. Be sure to put the name of your project’s virtual environment in line 1.

  7. Properly done, your file tree should now look something like this:

    Project file tree after installing Flask.

    Your local file tree after installing Flask and adding .gitignore.

  8. Run through the usual git status/add/commit process to save your progress.

  9. Finally, use git branch to check the name of your default branch.

    $ git branch
    * main
    

    If the default branch is NOT called main, change it with the command

    $ git branch -m old_branch_name main
    

Add Teammate(s) to Project

Finally, you need to grant your partner(s) permission to make changes to the remote repository.

  1. On the GitHub repository page, click the Settings button. Select the Manage Access option and click the green Invite teams or people button.

    Click "Settings" and "Manage Access" to let other users modify the repo.

    Give your team access to your repo.

  2. Next, enter the GitHub username for your partner. Be sure to grant them the proper level of access. Admin gives them the ability to delete the repo from your account at any time. The Write and Maintain roles allow them to edit the repo but not delete it.

    Enter a GitHub username, choose level of access, then click the Add button.

    Decide how much control you want to give your partner.

  3. When your partner logs into GitHub and visits the project URL, they will see an invitation to join the repository.

  4. Repeat steps 1 - 3 for each member of your team.

Partners: Clone the Project

Each partner on the project should clone a copy of the repository to their own device.

You and your team can now push changes up to GitHub and pull updates down to your machines. If you need a reminder how to do this, check out the Communication Log assignment.

Ready to Go!

Whew! This process gets easier with practice, and you now have a little more experience under your belt.

Now it’s time to git back to building your game!

Return to Assignment 6.