Let's Learn Git!

WARNING IF YOU DONT HAVE GIT GET IT NOW

Install instructions at github.com/gu-app-club/lets-learn-git then click LEARNME.md.

Who am I?

Computer Expert

Where I work:

Segment

  • SF based tech company (about 300ish people)
  • Big on open source
  • Big on smiles and good karma
  • Big on engineering teaching, diversity, and giving back to the industry

(ノ'ヮ')ノ*: ・゚

What is git?

what

Two things ✌️

  • Keeps track of older versions for you
  • Combines your code with someone elses

Version Control without git

version control

Merging code without git

merging code

Why learn git?

  • Great for jobs 💸
  • Only sane way to work in groups
  • Makes you a safer programmer
  • Exposes you to open source
  • Great for jobs
  • Only sane way to work in groups 👯‍♂️
  • Makes you a safer programmer
  • Exposes you to open source
  • Great for jobs
  • Only sane way to work in groups
  • Makes you a safer programmer 👷‍♀️
  • Exposes you to open source
  • Great for jobs
  • Only sane way to work in groups
  • Makes you a safer programmer
  • Exposes you to open source 🌎

First, some concepts

Concept 1 - Repository

A repository is a special folder that can live in multiple places.

Local Repository

Is a folder on your computer 💻

Remote Repository

Is a folder in the "cloud" ☁️

Repository == Folder

Git lets you sync between different repositories

For example, let's say the cloud repo looks like this:

$ ls 
- dogs.py
- README.md

And your repository looks like this:

$ ls 
- cats.py

We'll use git to combine them into this:

$ ls
- dogs.py
- cats.py
- README.md

Concept 2 - Git vs Github

Git is software!

Git is the tool that lets you create repositories.

GitHub is a repository!

GitHub is a place for you to dump your git repositories.

There's lots of internet repositories:

  • GitLab
  • BitBuckkit
  • SourceForge

Git != GitHub

Concept 3 - Commits and logs

Git let's you create points-in-time for your code called commits.

commit on Sept 8th at 1pm
- main.py
- cats.py
- dogs.py

commit on Sept 4th at 10am
- main.py
- cats.py

commit on Sept 1st at 2pm
- main.py

Commits are a collection of your changes

diff

An Overview of the Steps

Step 1

Make your change to the files

coding

Step 2

Add your changes to a "commit"

commit

Step 3

Pull down any changes someone else made

Pull

Step 3.5

You may need to manually merge your changes into their changes (git does this normally for you, but sometimes asks for help)

Merge

Step 4

Push your changes to GitHub

fire

Signing the README

The Great Tradition

sign

Lab Info

The repo lives at: https://github.com/gu-app-club/lets-learn-git and has a file called LEARNME.md, these are your instructions.

Your task is to sign your name to the list in the README.md file in the same repository.

The first step is easy, just clone (AKA download) the repository by typing the following command into your terminal:

git clone https://github.com/gu-app-club/lets-learn-git.git