Module 1: Git and GitHub

Introduction to Git

During this module, we will introduce a significant tool and resource: Git. Git is essential not only for managing your BloomTech projects but also for enabling collaboration with your future coworkers. Think of it as the 21st-century version of a project conference room, the electronic equivalent of a filing cabinet, and an application that will remain forever open on your computer.

What is Git and GitHub?

Git is a tool used to track code changes and collaborate with others. It allows multiple developers to work on the same codebase without interfering with each other's work, and it creates a history of changes made to files and folders over time. This history can be used to track down bugs, roll back changes, and communicate between developers.

Git serves as a tool to manage multiple versions of source code edit copies. GitHub serves as a location for uploading those edit copies to a repository.

The video walkthroughs will follow along with the GitHub repository linked here. Click the link and follow along for each step to best ensure your own computer setup works properly.

Why Git is Important

You will use Git throughout your career, making it an essential tool to learn and have installed on your machine. We don't expect you to be masters of Git after this lesson, so if you run into issues while using Git to access your code, don't hesitate to contact an instructor for help.

Introduction

What is Git?

Creating GitHub Account

Opening CLI

Configuring Your System

After creating your GitHub account, you'll need to configure Git on your local machine. This involves setting up your identity (name and email) and authentication method so Git knows who you are when you make changes.

Key Configuration Steps

  • Setting your name and email in Git
  • Setting up authentication (Personal Access Token)
  • Learning basic command line operations
  • Understanding how to fork repositories

These configurations only need to be done once on your system, and they'll apply to all your Git repositories. The videos below will walk you through each step of the process.

Configuring Name and Email

Authentication PAT

Forking

Command Line Basics

Navigating Git

Congratulations on finalizing your setup and configuration! You will now be introduced to some of the most used Git commands which allow you to track changes on your repositories, make snapshots of your files, and push those changes directly onto GitHub.

The video walkthroughs will follow along with the GitHub repository linked here. Click the link and follow along for each step to best ensure your own computer setup works properly.

Git Commands Cheat Sheet

  • git clone [url] - Clone a repository
  • git status - Check the status of your changes
  • git add [file] or git add . - Stage changes
  • git commit -m "message" - Commit changes with a message
  • git push - Push changes to remote repository

Cloning

Making Changes

Adding and Committing

Push with PAT

Git Workflow

How will you use Git and GitHub on a daily basis? The following videos will give you a peak into typical workflows and use cases.

Git Workflow

Use Case Example

Congrats!

Guided Project

In this guided project, you will learn about two of the most powerful tools that exist in software development: Git and GitHub. Git tracks the changes our project goes through over time and serves as a version control and backup system. Git allows the developer to craft time-stamped points in the development of a project we can later time-travel back to, branch off of, or restore our current files to. GitHub is our Git in the cloud, enabling powerful collaboration between team members working on the same project. With Git and GitHub, our projects are always safe!

Over the course of this GP, you...

Module 1 Project: Git and Github

Git is a version control system used by software developers to manage and track changes of your codebase. It provides numerous benefits and is necessary for efficient software development. It is a critical tool for you to learn, enabling you to work efficiently and collaboratively on projects of any size and complexity. GitHub is a web-based platform that uses Git as a version control system to host and manage software projects. It provides features for collaboration, code review, and project management, making it a popular choice for open-source development and other collaborative software projects.

The module project contains advanced problems that will challenge and stretch your understanding of the module's content.

If you can successfully complete all the Module Projects in a sprint, you are ready for the Sprint Challenge and Sprint Assessment, which you must pass to move on to the next Sprint.

Instructions

For today's Module project, you will:

  1. choose one of Sprint 1's Module Projects
  2. initialize a Git repo inside the project
  3. stage and commit all of your files
  4. create an empty remote repo on GitHub
  5. link together the remote repo and the repo on your computer
  6. push your commit to the main branch of the remote repo

Also! Imagine that you buy a new computer and need to download your project to it! You will:

  1. clone the remote repo to your hard drive
  2. make a few changes to the project
  3. stage, commit, and push your changes
  4. confirm that the changes appear on GitHub

Additional Resources