Skip to content

Latest commit

 

History

History
141 lines (134 loc) · 1.92 KB

slides.md

File metadata and controls

141 lines (134 loc) · 1.92 KB

GIT


For Derek: Memorizing Six Commands

Agenda

  • What is Git?
  • How we use Git
  • Hands-on training

What is Git?


Changes, not Code

Distributed

How we use Git


GitFlow

  • Upstream
  • Origin
  • Local

Forks

Clone

Create Local Repo:

$ git clone
https://github.com/<YOU>/git-lesson.git

Origin

Upstream

$ git remote add upstream
https://github.com/OpenWhere/git-lesson.git

One-way Data Flow

git fetch upstream
git checkout upstream/master
git branch my-feature
git checkout my-feature

Branches

  • Lightweight Pointers
  • Collections of Commits

Commits

  • Code Changes
  • Atomic

Pull Requests

  • One (or more!) Commits
  • Whole feature/bugfix
  • Great for Code Reviews

Code Reviews

  • Improve code quality
  • Hone skills
  • BEFORE merge (important for CI)

Hands-on Training


So far:

  • Forking
  • Cloning
  • Branching

Now:

  • Committing
  • Pushing/Submitting
  • Pull Requests
  • Merge Conflicts

Edit:

index.html
resources/generator.js

Committing

  • git status
  • git diff
  • git add -p
  • git diff --cached
  • git commit

Pushing/Submitting


Pull Requests

  • Review Code again
  • Write Descriptive Title
  • Add helpful description (screenshots!)

Code Reviews

  • Read the code in Github
  • Check out the code and test locally

git remote add derek [email protected]:owdd/git-lesson.git
git fetch derek
git checkout derek/<derek's branch name>`

Merge Conflicts

  • git fetch upstream
  • git branch (verify correct branch)
  • git merge upstream/master
  • Resolve conflicts
  • git commit -a
  • git push origin my-feature

Questions?


Thanks!