Intro to Computer Science

Follow the steps below to create your GitHub account and first respository, download and install VS Code, and make your first commit into your repository.

Create a GitHub account

  1. Start at GitHub.com.

  2. Click sign up in the upper-right.

  3. Complete the form to set up your github username.

    • IMPORTANT: Choose your username wisely! It will be visible as when you share your repository.

    GitHub Create

Create a Repository

  1. From the upper-right click on the plus and choose New Repository

    GitHub Add Repository

  2. Enter the following:

    • A repository name - something like IntroToCs.
    • Choose Private
    • Check the Add a README file checkbox

    GitHub Create Repository

  3. Click the Create Repository button.

Add me as a Collaborator

Since this repository is private you will need to add me as a collaborator so I can see your homework assignments.

  1. From within your respository, click on the Settings in the upper toolbar.

    GitHub Repository Settings

  2. Then click the Manage Access menu option on the left.

    GitHub Repository Manage Access

  3. Then from the center panel click the Invite a Collaborator button.

    GitHub Repository Invite

  4. Enter my email address in the modal dialog that pops up and then click the Add to Repository button.

    GitHub Repository Invite

  5. You should see the pending invite under the Manage Access section.

    GitHub Repository Pending Invite

Git

  1. Download and Install Git from https://git-scm.com/download.

Visual Studio Code

  1. Download and Install Visual Studio Code from https://code.visualstudio.com/.

Clone your repository

  1. Open Visual Studio Code.

  2. Click on the Explorer icon in the left side tool bar (the one that looks like two sheets of paer on top of each other) or use the Ctrl+Shift+E hotkey to open the Explorer window.

  3. Click the Clone Repository button.

    VSCode Clone Repo

  4. Enter the url to the repository that you just created. It will be something like https://github.com/[USERNAME]/IntroToCs

    VSCode Clone from GitHub

  5. Select a folder to clone the GitHub repo locally.

  6. Browse to the folder on your computer to confirm you see the files on your computer (and to associate that this folder on your computer matches the GitHub Repository).

Your first commit

  1. Open Visual Studio Code.

  2. On the VSCode left side tool bar there are icons for the Explorer and for Source Control (or GitHub).

    VSCode Open Explorer

  3. Click the Explorer icon to open to show your files in your repository that you just cloned.

    • If you do not have a folder open, then click the Open Folder button and select the folder on yoru computer where you cloned your repository.
  4. In the Explorer panel, click on the README.md file. The contents will load to the right.

    • You can see a preview of your page by clicking the Preview button at the top of the README.md.

    VSCode Editor

  5. Make a change to the readme by editing the README.md file in the center panel. Add your name. Then put your first name in bold and your last name in italics using markdown formatting.

    VSCode Editor Preview

  6. Save the file (Ctrl+S).

  7. Open the Source Control panel by clicking the Source Control button in the left side toolbar.

  8. Under the Changes section, stage the change by clicking the '+' button next to the README.md file.

    VSCode Stage Changes

  9. Commit the change by entering a comment in the textbox and then clicking the commit checkbox in the source control toolbar.

    VSCode Commit

  10. NOTE: You may get an error at this point where you need to set your Git email and name. To do this, open Terminal and paste and run the following commands (putting in your own email and name). And then repeat the prior set to commit your changes.

    git config --global user.email "youremail@gmail.com"

    git config --global user.name "your name"

    VSCode terminal

    VSCode terminal

  11. Finally push the changes up to your repository by clicking the menu button in the source control toolbar '...' and then selecting push.

    VSCode Push

  12. To confirm your changes are now on your repository, visit your repository at github.com to see that the change is there.

     ![VSCode First Commit](/images/vscode-my-first-commit.png)
    

Continue with this week's homework assignment to learn more about Markdown formatting and making changes to your repository.