Slide 1

Slide 1 text

GIT a simple introduction

Slide 2

Slide 2 text

version control Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later

Slide 3

Slide 3 text

file management Image from: http://hginit.com/01.html

Slide 4

Slide 4 text

life without version control • Without version control, you can just keep multiple copies of files • Takes up disk space for larger files • Confusing as to which file is most up to date

Slide 5

Slide 5 text

version control is for keep track of file changes

Slide 6

Slide 6 text

git is for non-binary files • Hard to diff images and binary files • Who made the last change? How do you merge them? • Text files == git

Slide 7

Slide 7 text

some key words • commit: a state of the repository at a single time • repository: a database containing your history and configuration • index/staging area: a cache between your working directory and your repository • clone: the act of copying a repository or a copy of the repository

Slide 8

Slide 8 text

some key words • branch: a line of development. It’s a “label” that points to a commit • head: the top commit on a branch. Most recent in a branch’s history • upstream: a copy of a given repository. An “original” copy of the repository history • tag: a description of a given commit. Can be cryptographically signed.

Slide 9

Slide 9 text

Usage of git

Slide 10

Slide 10 text

showing changes

Slide 11

Slide 11 text

showing change history

Slide 12

Slide 12 text

edit the file and do a “git diff”

Slide 13

Slide 13 text

and now add and commit the files

Slide 14

Slide 14 text

What does git log about our repository?

Slide 15

Slide 15 text

git shows change history by date descending

Slide 16

Slide 16 text

delete a file!

Slide 17

Slide 17 text

Unless you commit your changes

Slide 18

Slide 18 text

git can revert to your previous history state

Slide 19

Slide 19 text

checkout your previous repository state

Slide 20

Slide 20 text

1. Make some changes 2. See if they work 3. If they do, commit them 4. If they don’t, checkout your last state 5. GOTO 1 A git workflow

Slide 21

Slide 21 text

git can only keep track of files you’ve told it about in the past

Slide 22

Slide 22 text

use git add to stage a file into the git index

Slide 23

Slide 23 text

use cases for git-like systems • tracking code history • mirroring the history of a set of files • collaborating with multiple users in a distributed fashion • sharing result-sets from commands • modifying docx files and sharing history quickly

Slide 24

Slide 24 text

caveats • since git is distributed, not as fun alone • need to keep abreast of changes in the main remote branch • more annoying across multiple operating systems • lots of weird commands and states you have to deal with

Slide 25

Slide 25 text

alternatives • dropbox! • layervault/version cue for photoshop • mercurial

Slide 26

Slide 26 text

easy git clients • github for mac/windows • sourcetree for mac/windows • smartgit on windows • gitx for mac

Slide 27

Slide 27 text

moar resources • github’s interactive tutorial: https://try.github.io/ levels/1/challenges/1 • git immersion: http://gitimmersion.com/ • code school: https://www.codeschool.com/courses/ try-git • pro git book (free): http://git-scm.com/book

Slide 28

Slide 28 text

questions?