Skip to content

brittanyrw/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Intro to Git & GitHub - Presentation

Intro to Git and GitHub Header

πŸ‘‹πŸΎ Introduction

This is supporting documentation for a 25 minute (‼️) Intro to Git & GitHub Workshop. In this verry quick overview, you will learn about Git and GitHub, some of the most popular version control tools. We will cover the command line, commonly used Git commands, what open source is and how you can utilize Git and GitHub to manage your own projects and to collaborate with others.

πŸ€” What is Git?

Gif of someone attempting to heard a bunch of kittens and failing

Git is a version control system used to track and manage changes made to files. This tool allows teams to work more efficently together and avoid mistakes that might arise from conflicting code, bugs and so on. Benefits of using version control include:

  • Ability to track what code has been changed
  • Ability to see who has changed it
  • Ability to see when it was changed
  • And the option to revert to previous versions if needed

Further Reading:

🧐 What is GitHub?

GitHub Octocats

GitHub is a website where you can host code, collaborate with others and utilize Git version control tools. Note: Very important to remember that Git and GitHub are two different things. Some features of GitHub include:

  • Collaboration (open-source): View other people's code and collaborate on projects.
  • Storage: Upload your code to store it remotely vs just on your local machine.
  • Hosting: Deploy websites with the option of custom domains
  • Management: Automation, manage to do lists (Projects), create Wikis, team organization
  • And much more

Alternatives: Gitlab & Bitbucket

Further Reading:

πŸ›  Git and GitHub Setup

Below are instructions for how to set up Git and GitHub on your computer.

  • Create an account on GitHub - https://github.com/join
  • Download and install Git - https://git-scm.com/downloads
    • For Macs: if you do not already have homebrew installed and are not familiar with using the command line, you can use the Binary installer.
  • Download a Text Editor. A text editor is a program that you use to modify and write code. If you do not already have a text edtior, here are some suggestions:

πŸ‘©πŸΎβ€πŸ’» Command Line

Screenshots of the command line The command line is a text interface that you can use to run commands on your computer. Mac (Terminal) and Windows (Powershell) computers both come with default command lines. You can find and open these command lines by searching for the name (Terminal or Powershell) on your computer.

Alternative Command Lines

Command Line Resources

πŸ¦„ Git Commands

Screenshots of the command line We're going to briefly go over just a few of the most commonly used Git commands below. These will get you started using Git but there are many more commands you can utilize. Check out the resources after this section for more information.


Screenshot of terminal running git init command

Git Init

git init initializes Git. After this command is run, Git will start tracking your files.

  • Run inside of a directory (folder). Any changes you make in that folder will then be tracked by Git.

Further Reading:


Screenshot of terminal running git status command

Git Status

git status outputs the status of your files. This is a command that is used very often.

Some information git status can give you includes:

  • What branch you are on
  • Which files are being tracked
  • Which files have been altered
  • What the status is of your local branch vs the remote branch

Further Reading:


Screenshot of terminal running git add command

Git Branch

git branch creates a new branch, or an parallel snapshot of your project that is seperate from the main branch.

  • Branches are created so that individual engineers can work on the same codebase without impacting the main project code.
  • Create a new branch with git branch branch-name-goes-here and switch to that branch using git checkout branch-name-goes-here
  • To create a new branch and switch to that branch with one command use git checkout -b branch-name-goes-here

Further Reading:


Screenshot of terminal running git add command

Git Add

git add tells Git which files to add to the staging area before comitting.

  • Can add all files: git add .
  • Can add individual files: git add index.html main.css

Further Reading:


Screenshot of terminal running git commit command

Git Commit

git commit saves a snapshot of your entire project. You run the command with the -m flag to include a message. This message will typically explain what was changed in the code. Here is an example of what running git commit could look like: git commit -m β€œyour commit message here”. You should commit often! Further Reading:


Screenshot of terminal running git push command

Git Push

git push sends code from your local branch to your remote branch. In this case, it is sending to GitHub.

Further Reading:

Additional Commands

For a list additional commands you should learn check out this GitHub Git Command Cheatsheet.

πŸ“š Git & GitHub Resources

πŸ₯³ Practice and Contribute

Alright, so you now know the basics of using Git and Github. What's next? To become more comfortable using the command line, Git and Github you're going to need to practice. Below is a list of a few suggestions for how to practice on your own and a list of open source projects that have extensive contribution documentation that makes it easier for beginners to contribute.

πŸ“Ί EmojiScreen

EmojiScreen is a project I made a couple of years ago to help beginners make their first pull requests on GitHub. The website is a listing of movies, TV shows and musicals depicted through emojis. To contribute, you can add an Emoji Card that includes five emojis related to the show or movie you want to add so that other people can guess. For more advanced learners, you an also try your hand at adding new features or improving the existing code. Head over to the EmojiScreen repository where there are extremely detailed instructions that walk yoiu step by step through how to contribute!

How to Practice

Gif of Blossom from Powerpuff Girls flying

Other Projects to Contribute to

Logos for companies that have open source projects

  • Forem/Dev.to - Open source software for building communities
  • Gatsby - Build blazing fast, modern apps and websites with React
  • Netlify CMS - A Git-based CMS for Static Site Generators
  • P5.js - A JavaScript library for creative coding
  • FreeCodeCamp - A friendly community where you can learn to code for free

About

Presentation for Intro to Git & Github Workshop (25mins) for Tech, Rebalanced 2020

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published