Fundamentals (Paid)
  • 🚀Course Overview
  • Course Logistics
    • 🏫Course Methodology
      • 🧩Course Components
      • 💬Community Channels
      • 🎲Course Projects
    • 💻Required Hardware and Software
      • ☝️Required Software 1
      • ✌️Required Software 2
      • 👍Recommended Setup
    • 🗓️Schedule
    • 💡Tips and Tricks
      • 📒Coding Strategies
      • 🛠️Tooling Pro Tips
    • 🎓Post-Course
      • 🎓LinkedIn Certificates
      • 🚂Bootcamp Admission Criteria
  • 1: Introduction
    • 1.1: What is Coding?
    • 1.2: Web Browsers
    • 1.3: Command Line
    • Additional Resources 1
  • 2: Basic Data Manipulation
    • 2: Operators and Expressions
      • 2.1: Arithmetic Operators | Mathematical Expressions
      • 2.2: Assignment Operators | Variables
    • 2.3: Our First Program
    • Additional Resources 2
  • 3: Structuring and Debugging Code
    • 3.1: Functions
    • 3.2: Errors
    • Additional Resources 3
  • 4: Conditional Logic
    • 4.1: Intro to Logic
    • 4.2: Pseudo-Code, Boolean Or
    • 4.3: Boolean AND, NOT
    • 4.4: Input Validation
    • Additional Resources 4
  • 5: Managing State and Input Validation
    • 5.1: Program Lifecycle and State
    • 5.2: Program State for Game Modes
    • Additional Resources 5
  • 6: Arrays and Iteration
    • 6.1: Arrays
    • 6.2: Loops
    • 6.3: Loops with Arrays
    • Additional Resources 6
  • 7: Version Control
    • 7.1: Git
    • Additional Resources 7
  • 8: GitHub
    • 8.1: Intro to GitHub
    • 8.2: GitHub Fork and Clone
    • 8.3: GitHub Pull Request
    • 8.4: GitHub Repo Browsing
    • 8.5: Deployment
    • Additional Resources 8
  • 9: JavaScript Objects
    • 9.1: JavaScript Objects
    • 9.2: Card Deck Generation with Loops
  • 10: Advanced
    • 10.1 HTML
    • 10.2: CSS
    • 10.3: The Document Object Model
    • 10.4: DOM Manipulation
    • 10.5: Advanced Debugging with Sources Tab
  • 11: POST COURSE EXERCISES
    • DOM
    • Further Readings
  • In-Class Exercises
    • Day 2: Basic File and Data Manipulation
    • Day 3: Functions
    • Day 4: If Statements, Boolean Or, Boolean And
    • Day 5: Program State
    • Day 6: Scissors Paper Stone Redux
    • Day 7: Loops
    • Day 8: Arrays and Loops
    • Day 9: Beat That Redux
    • Day 10: Moar Cards / Chat Bot
    • Day 11: Blackjack Redux, DOM
  • Projects
    • Project 1: Scissors Paper Stone
      • Project 1: Scissors Paper Stone (Part 1)
      • Project 1: Scissors Paper Stone (Part 2)
    • Project 2: Beat That!
    • Project 3: Blackjack
  • Past Projects
    • Drawing With Emojis
    • Guess the Word
Powered by GitBook
On this page
  • Learning Objectives
  • Introduction
  • GitHub Fork
  • Git Clone
  • Git Push
  • Cheatsheet
  • Exercise
  1. 8: GitHub

8.2: GitHub Fork and Clone

Previous8.1: Intro to GitHubNext8.3: GitHub Pull Request

Last updated 2 years ago

Learning Objectives

At the end of this lesson, you should:

  • Be able to use the GitHub Fork feature.

  • Be able to use the git clone command.

  • Be able to use the git push command.

Introduction

We will learn more features of Git and GitHub to start and submit SWE Fundamentals projects. As a reminder, Git is the version control system and GitHub is the code-hosting website built on top of Git. GitHub extends the capabilities of Git by adding visual code browsing, social features, and collaboration features.

In the below video we demonstrate git push origin master, but for SWE Fundamentals git push will suffice. origin refers to the target Git remote, and master refers to the target branch. Rocket Academy has updated our repos to use main as the default branch name as per GitHub's latest convention, so if you wanted to specify the full command including remote and branch for SWE Fundamentals, you could use git push origin main.

GitHub Fork

"Fork" is the GitHub term for copying a repo from one GitHub account to another. We can fork a repo by clicking the Fork button on a given GitHub repo page. Forking allows us to make changes to a repo and save those changes to our own GitHub account's copy of the repo. Our account's repo is essentially independent from the original, forked repo.

"Fork" is a GitHub concept. Forking is not built-in to the Git version control system.

Git Clone

Command Template

git clone <REPO_DOWNLOAD_URL> <LOCAL_REPO_FOLDER_NAME>

Sample Command

git clone https://github.com/rocketacademy/fundamentals-starter-code.git fundamentalsash-starter-code-test

GitHub enables us to coordinate differences between local and "official" versions of the code, but we won't concern ourselves with that just yet.

Git Push

We will learn 1 new Git command push to send local code commits from our computers to GitHub. push can also be used as a general command to move code between "remote" repos, but during SWE Fundamentals we will only be using push to push code to GitHub.

Cheatsheet

Here is the workflow for SWE Fundamentals projects:

  1. Go to the project repo page. Click the "Fork" button to copy the repo to our own GitHub account.

  2. In the command line on our local computer, clone the repo from our own Github account's copy of the repo.

  3. git push our changes to our repo. Refresh the repo page to see our commits in the repo.

Exercise

  1. Clone the repo into a folder on your local machine.

  2. Once you start working on your project, make frequent commits and use git push to update your GitHub repo.

We'll use a Git command to download or "clone" a copy of SWE Fundamentals starter code. <REPO_DOWNLOAD_URL> is the download URL of our repo, obtained by clicking the Download Code button on the repo's . <LOCAL_REPO_FOLDER_NAME> is the name of the destination folder that is created (containing the contents of the repo) when we run the Git command.

Once the repo is on our computer, make the changes we want, and follow the Git workflow and to commit those changes.

Create a in GitHub. This connects our work on the repo in our account to the original Rocket Academy repo. Fill in the survey and submit.

Fork a copy of the as setup for Project 2.

GitHub page
pull request
Fundamentals Beat That! repo
How to find the fork button on a repo page.
A "fork" is when we copy a repo from another account to our own inside of GitHub.
Clone a repo onto your computer from GitHub
The "git push" command can be used to send local code commits to GitHub.
cheatsheet