Rocket Academy Bootcamp
  • 🚀Welcome to Bootcamp!
  • 🛠️Logistics
    • Course Schedules
    • Course Methodology
    • Required Software
    • LinkedIn Education Badge
  • 📚General Reference
    • Naming, Casing, and Commenting Conventions
    • VS Code Tips
    • Recommended Resources
  • 🪨0: Foundations
    • 0.1: Command Line
    • 0.2: Git
      • 0.2.1: Branches
    • 0.3: GitHub
      • 0.3.1: Pull Requests
    • 0.4: JavaScript
      • 0.4.1: ES6
      • 0.4.2: Common Syntax
      • 0.4.3: Reference vs Value
      • 0.4.4: Classes
      • 0.4.5: Destructuring and Spread Operator
      • 0.4.6: Promises
        • 0.4.6.1: Async Await
    • 0.5: Node.js
      • 0.5.1: Node Modules
      • 0.5.2: NPM
      • 0.5.3: Nodemon
  • 🖼️1: Frontend
    • 1.1: HTML
    • 1.2: CSS
      • 1.2.1: Layout
    • 1.3: React
      • Styling in ReactJs
      • Using Styling Libraries with React
      • React Deployment
    • 1.E: Exercises
      • 1.E.1: Recipe Site
      • 1.E.2: Portfolio Page
      • 1.E.3: World Clock
      • 1.E.4: High Card
      • 1.E.5: Guess The Word
    • 1.P: Frontend App
  • 🏭2: Full Stack
    • 2.1: Internet 101
      • 2.1.1: Chrome DevTools Network Panel
      • 2.1.2: HTTP Requests and Responses
    • 2.2: Advanced React
      • 2.2.1: AJAX
      • 2.2.2: React Router
      • 2.2.3: useContext
      • 2.2.4: useReducer
      • 2.2.5: Environmental Variables
      • 2.2.6: React useMemo - useCallback
    • 2.3: Firebase
      • 2.3.1: Firebase Realtime Database
      • 2.3.2: Firebase Storage
      • 2.3.3: Firebase Authentication
      • 2.3.4: Firebase Hosting
      • 2.3.5: Firebase Techniques
    • 2.E: Exercises
      • 2.E.1: Weather App
      • 2.E.2: Instagram Chat
      • 2.E.3: Instagram Posts
      • 2.E.4: Instagram Auth
      • 2.E.5: Instagram Routes
    • 2.P: Full-Stack App (Firebase)
  • 🤖3: Backend
    • 3.1: Express.js
      • 3.1.1 : MVC
    • 3.2: SQL
      • 3.2.1: SQL 1-M Relationships
      • 3.2.2: SQL M-M Relationships
      • 3.2.3: SQL Schema Design
      • 3.2.4: Advanced SQL Concepts
      • 3.2.5: SQL - Express
      • 3.2.6: DBeaver
    • 3.3: Sequelize
      • 3.3.1: Sequelize One-To-Many (1-M) Relationships
      • 3.3.2: Sequelize Many-To-Many (M-M) Relationships
      • 3.3.3: Advanced Sequelize Concepts
      • 3.3.4 Database Design
    • 3.4: Authentication
      • 3.4.1: JWT App
    • 3.5: Application Deployment
    • 3.E: Exercises
      • 3.E.1: Bigfoot JSON
      • 3.E.2: Bigfoot SQL
      • 3.E.3: Bigfoot SQL 1-M
      • 3.E.4: Bigfoot SQL M-M
      • 3.E.5: Carousell Schema Design
      • 3.E.6: Carousell Auth
    • 3.P: Full-Stack App (Express)
  • 🏞️4: Capstone
    • 4.1: Testing
      • 4.1.1: Frontend React Testing
      • 4.1.2: Backend Expressjs Testing
    • 4.2: Continuous Integration
      • 4.2.1 Continuous Deployment (Fly.io)
      • 4.2.2: Circle Ci
    • 4.3: TypeScript
    • 4.4: Security
    • 4.5: ChatGPT for SWE
    • 4.6: Soft Skills for SWE
    • 4.P: Capstone
  • 🧮Algorithms
    • A.1: Data Structures
      • A.1.1: Arrays
        • A.1.1.1: Binary Search
        • A.1.1.2: Sliding Windows
      • A.1.2: Hash Tables
      • A.1.3: Stacks
      • A.1.4: Queues
      • A.1.5: Linked Lists
      • A.1.6: Trees
      • A.1.7: Graphs
      • A.1.8: Heaps
    • A.2: Complexity Analysis
    • A.3: Object-Oriented Programming
    • A.4: Recursion
    • A.5: Dynamic Programming
    • A.6: Bit Manipulation
    • A.7: Python
  • 💼Interview Prep
    • IP.1: Job Application Strategy
    • IP.2: Resume
    • IP.3: Portfolio
Powered by GitBook
On this page
  • Learning Objectives
  • Introduction
  • GitHub Workflow Summary
  • GitHub Fork
  • Git Clone
  • Git Push
  • Git Pull
  • How to view commit history in GitHub
  • Additional Resources
  1. 0: Foundations

0.3: GitHub

Learning Objectives

  1. GitHub is a code-hosting website that hosts Git repos for individuals or teams to review and collaborate on

  2. Know how to fork a repo on GitHub

  3. Know how to clone a repo from GitHub

  4. Know how to push changes to GitHub

  5. Know how to pull changes from GitHub

  6. Know how to view repo commit history in GitHub

Introduction

GitHub is a code-hosting website that hosts Git repos for individuals or teams to review and collaborate on. Team members can easily review latest code changes and commit history, making software development more transparent and thorough.

GitHub Workflow Summary

  1. Fork repos we do not have edit access to to suggest changes or maintain our own copy

  2. Clone repos to download local copies of GitHub repos

  3. Once we have committed the changes we want locally, push our changes to GitHub to share them with others. Refresh the GitHub repo page to see those changes.

  4. If we are working with teammates and wish to download their code while keeping local changes, pull their code from GitHub after committing our local changes.

GitHub Fork

A GitHub "fork" is a copy of another GitHub repo. SWEs typically "fork" repos they do not have edit access to either to make improvements to merge back into original repos, or to create and maintain independent versions of repos. At Rocket Academy we will fork Rocket exercise repos to complete and submit assignments.

We can fork a repo by clicking the Fork button on a GitHub repo page. Once forked, we can change our copy of the repo without affecting the original.

Git Clone

Click the copy button in the Code dropdown menu on the GitHub page of the repo we wish to edit.

Then go to terminal, cd to the relevant folder and enter the command git clone <repo-url>, where <repo-url> is the URL we just copied from GitHub. This will create a new folder named after the repo with the repo's contents inside.

bootcamp % git clone https://github.com/kai-rocket/react.git
Cloning into 'react'...
remote: Enumerating objects: 203678, done.
remote: Total 203678 (delta 0), reused 0 (delta 0), pack-reused 203678
Receiving objects: 100% (203678/203678), 173.82 MiB | 5.85 MiB/s, done.
Resolving deltas: 100% (144768/144768), done.
bootcamp %

Once we've cloned the repo we can make edits to it and track our changes with Git.

Git Push

git push allows us to share local changes by "pushing" local commits to GitHub for others to view. Video demo below.

Git Pull

git pull allows us to download new changes in a shared GitHub repo (e.g. by teammates) while keeping our local changes. Git will automatically merge downloaded and local changes, and let us know if there are "merge conflicts", for example if downloaded and local changes edit the same lines of code. We will work more with git pull once we start group projects.

How to view commit history in GitHub

GitHub provides an easy way to view past changes to a repo. For example, if we are wondering which commit changed a line of code that caused a bug, we can easily find which commits changed that line, who made those commits and what other changes were in those commits.

Additional Resources

  1. (Below) Intro to GitHub video from prior version of Rocket's Coding Basics course

  2. (Below) GitHub Fork video from prior version of Rocket's Coding Basics course

  3. (Below) GitHub Repo Browsing video from prior version of Rocket's Coding Basics course

In the below GitHub Fork video we demonstrate git push origin master, but for most purposes git push will suffice.

Previous0.2.1: BranchesNext0.3.1: Pull Requests

Once we have edit access to the repo we want to edit, either by forking an existing repo or , we can "clone" (i.e. download) that repo to our local machine to make changes to it.

(blog post)

(video playlist)

🪨
creating a new repo
Git and GitHub in Plain English
Git and GitHub by The Coding Train
Demonstration of how to push local changes to GitHub
Intro to GitHub video from prior version of Rocket's Coding Basics course
GitHub Fork video from a prior version of Rocket's Coding Basics course
GitHub Repo Browsing video from prior version of Rocket's Coding Basics course
Click the Fork button to fork a repo
Fork menu; We typically keep the same repo name for clarity
Forked repo; Notice the repo is now under my account
Click the copy button in the Code dropdown to copy the repo link to use with git clone
Click the number of commits on a repo's GitHub page to view a list of all its commits
Click on any commits in the repo's commit history to view the details of that commit
We can review complete details of each commit in GitHub