Skip to content

steph1111/F23_CS11_SI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

F23_CS11_SI

Fall 2023 CS-11 Supplemental Instruction


GitHub Repo
F23_CS11_SI »

Discord · Canvas · Replit


Table of contents

Getting started

0️⃣ Installing git (Cygwin)

If you are on Windows, you have probably already installed Cygwin on your device. When you were installing, Cygwin gave you the option to install additional packages, one of these was for Git. Chances are you did not install this, but that is okay we can add packages after installation (kinda). There is no package management in Cygwin outside of the setup program, so you will have to run setup-x86_64.exe again.

  1. Open File Explore then to Downloads on your device
  2. Search for setup-x86_64.exe and open the file
  3. Go through the set up process again (choose the same options as last time) until you reach the Select Packages page. Here use the search tool to search for "Git". Choose the package named Git with description Distributed version control system packages Note: now is a good time to install any additional packages you may want like Vim
  4. Finish the rest of the set up process
  5. Open your Cygwin terminal and confirm git has been properly installed by running
    git --version
    You should get back something that looks like git version 2.39.0

0️⃣ Installing git (Mac and Linux)

  1. By default, git should be installed on Mac and Linux systems
  2. Confirm git is installed by running the following command in your terminal
    git --version
    You should get back something that looks like git version 2.39.0
  3. If you did not get a version number, follow the this guide: Install Git

1️⃣ Create a GitHub account

GitHub is the free web based platform we and many other software engineers use to share and collaborate on projects as well as control version history. Screen Shot 2023-09-10 at 7 39 35 AM

  1. Go to GitHub and follow the steps to create an account
  2. Return to the terminal (cygwin or your standard terminal) to configure git
  3. Set up your username using the following command where <your_GitHub_username> is the username you chose when creating your GitHub account
    git config --global user.name <your_GitHub_username>
    git config --global user.name CS11SI
  4. Set up your email using the following command where <your_GitHub_email> is the email you used when creating your GitHub account
    git config --global user.email <your_GitHub_email>
    git config --global user.email stlheure@cabrillo.edu

2️⃣ Set up SSH (Cygwin)

  1. Open Cygwin as Administrator and enter the following command to configure SSH

    ssh-host-config
  2. Enter yes for the prompts

  3. You will be prompted to with the text below

    ***Query: Enter the value CYGWIN for the daemon: []

    For the value enter ntsec

    ***Query: Enter the value CYGWIN for the daemon: [] ntsec

2️⃣ Set up SSH (Mac and Linux)

  1. SSH should already be on Mac and Linux systems

3️⃣ Generate an SSH key

  1. Generate an SSH key to connect your system to your GitHub account
    ssh-keygen
    • When it asks for the location to put the file hit enter
    • Also just hit enter when it asks for the password, unless you can remember it
  2. Copy the generated ssh key
    cat ~/.ssh/id_rsa.pub

4️⃣ Add the SSH key to GitHub

  1. Return to GitHub and open your settings by clicking on your icon then ⚙️ settings

  2. Scroll to 🔑 SSH and GPG keys

    Tabs
  3. Click the New SSH Key button located in the top right corner.

  4. Choose a name for the key (something such that you'll remember what computer/system it was for)

  5. Paste the key from step 2 into the Key box

  6. Save the key by clicking Add SSH Key


5️⃣ Fork the repo to your account

  1. Open the F23_CS11_SI GitHub repo in your browser: https://github.com/steph1111/F23_CS11_SI

  2. At the top of the page click on fork

    fork
  3. Follow the steps to fork the repo to your account by creating a new fork. Click on create fork when you are finished. This creates your own personal version of this repository

    fork page

6️⃣ Clone your forked repo to your system

  1. Open your forked repo. At the top of the page click the green code button. Open the SSH tab and copy the link

    Screen Shot 2023-09-10 at 6 50 51 PM
  2. Return to your terminal and navigate using cd to where you would like this repo contents to live with your file system

  3. To clone your repo use the git clone command and paste the link from step 1. This points to the existing repo on GitHub and makes a connected copy, or clone, on your system

    git clone <link_here>

    Here is an example of how I would clone my repo (your link is different)

    git clone git@github.com:steph1111/F23_CS11_SI.git
  4. To confirm the clone was successful list your files with ls. You should see the name of the cloned repo in your current directory


Maintaining your repo

0️⃣ Sync and pull the changes

I will be updating my upstream version of your repo before SI sessions to add new content. In order to get the new content into your forked repo you must sync and pull the changes. Every time you want to work on your repo I recommend heading to your forked repo and seeing if there are upstream changes to be synced and pulled

  1. Open your forked repo in GitHub. If there are no changes you should see a message that looks like the following stating this branch is up to date. If this is the case it means I have not made changes and you can ignore the following steps. up_to_date

  2. If there are upstream changes to merge there should be a message on this page similar to the following: x_commits_behind This means I have main changes to the upstream repo that need to be synced to your fork

  3. Click on the button titled 🔄 Sync fork, you should see a window stating the code is out of date. Click update branch

  4. Next navigate to your fork on your system

  5. Enter the command git pull to pull the changes on GitHub onto your device

    git pull
  6. Work on the exercises as you would any code on your device


1️⃣ Commit your changes

Once you make some changes you would like to be documented you need to commit them. Committing changes is how you can mark versions of your code you would like to be tracked. It is a good idea to commit changes before and after you add/remove a feature that way there is a record of your changes. Also commit changes after you have finished a session of programming then push (see following section)

  1. To commit changes you use the git commit command. The parts of the command are as follows:

    • git: Denotes we are using a git command
    • commit: The name of the command is commit, this is what we would like to do
    • -m: This is a flag that says we would like to add a commit message
    • "Message here: Between quotes state what changes you are committing
    • file_name: Replace this with the file you wish to commit

    All together the git commit command syntax looks like this:

    git commit -m "Message here" file_name

    An example commit may be

    git commit -m "Added endl to move to the next line" hello.cpp
  2. You will receive a short message summarizing the changes


2️⃣ Push your changes

Once you have finished a coding session it is a good idea to push your commits. The push command is basically the opposite of pull. push takes the changes (commits) you made on your local system and sends them to GitHub. IMPORTANT: always push before you pull!

  1. Commit your changes (see above)
  2. Enter the command git pull to push the changes from your system to GitHub
  3. You can confirm this worked by heading to Github and seeing the changes reflected on your repo page

About

Repo for everything we do in CS-11 SI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages