1 of 13

Slide Notes

DownloadGo Live

Git

Published on Nov 18, 2015

Intro to Git

PRESENTATION OUTLINE

Git

Photo by Junior Henry.

Distributed.
Everything is local.

Photo by sickmouthy

Getting started . . .


git init
OR
git clone

Photo by kjetikor

git status

  • untracked (git add)
  • unmodified
  • modified (git add)
  • staged (git commit) careful!
  • unmodified
Photo by tanakawho

git diff
working:staged

git diff --staged
staged:last commit

Photo by btting

Branching. Git's killer feature.

Photo by Dreemreeper

"Git encourages a workflow that branches and merges often, even multiple times in a day."

Photo by orangejack

A branch is a pointer to one commit
git branch branchname

Photo by Leo Reynolds

HEAD points to your current branch

git checkout branchname

Photo by Werner Kunz

Git identifies the common ancestor for merging

git merge branchname
"fast-forward"

Photo by orangejack

Remotes.

git remote add shortname url
git remote -v
git remote show shortname

Photo by redjar

git fetch
:gets but does not merge
git pull
:gets and attempts to merge

Remote Branches

  • Local pointer for remote commits  
  • (remote)/(branch)
  • git fetch updates pointers
  • git fetch brings down new branches
  • checkout new branches for working copy