Slide 1

Slide 1 text

Git Introduction For Subversion Users Ran Tavory Totango Sunday, May 25, 14

Slide 2

Slide 2 text

Why Git? • Because IT IS BETTER Sunday, May 25, 14

Slide 3

Slide 3 text

Git is a File System Sunday, May 25, 14

Slide 4

Slide 4 text

All (most) Operations are Local and Fast! • Commit • Log (view history) • Diff • ... Sunday, May 25, 14

Slide 5

Slide 5 text

Git is Distributed Sunday, May 25, 14

Slide 6

Slide 6 text

Git is Fast Sunday, May 25, 14

Slide 7

Slide 7 text

Lightweight (and local) Branching Sunday, May 25, 14

Slide 8

Slide 8 text

Data Integrity Sunday, May 25, 14

Slide 9

Slide 9 text

Staging Area Sunday, May 25, 14

Slide 10

Slide 10 text

Stash Area Sunday, May 25, 14

Slide 11

Slide 11 text

Sunday, May 25, 14

Slide 12

Slide 12 text

Git Setup $ brew install git $ git config --global user.name “Ran Tavory” $ git config --global user.email “[email protected]” https://gist.github.com/rantav/ 5d6fb14057f062ecbc70 Sunday, May 25, 14

Slide 13

Slide 13 text

GitHub Setup https://help.github.com/articles/ set-up-git Sunday, May 25, 14

Slide 14

Slide 14 text

Clone the Repo $git clone https://github.com/ totango/main.git Sunday, May 25, 14

Slide 15

Slide 15 text

git status Sunday, May 25, 14

Slide 16

Slide 16 text

git add Sunday, May 25, 14

Slide 17

Slide 17 text

git diff Sunday, May 25, 14

Slide 18

Slide 18 text

git commit Sunday, May 25, 14

Slide 19

Slide 19 text

git commit --amend Sunday, May 25, 14

Slide 20

Slide 20 text

git checkout Sunday, May 25, 14

Slide 21

Slide 21 text

git rm Sunday, May 25, 14

Slide 22

Slide 22 text

git mv Sunday, May 25, 14

Slide 23

Slide 23 text

git log Sunday, May 25, 14

Slide 24

Slide 24 text

git log -p Sunday, May 25, 14

Slide 25

Slide 25 text

git log --word-diff Sunday, May 25, 14

Slide 26

Slide 26 text

git log --stat Sunday, May 25, 14

Slide 27

Slide 27 text

git log hacking Sunday, May 25, 14

Slide 28

Slide 28 text

git remote Sunday, May 25, 14

Slide 29

Slide 29 text

git pull Sunday, May 25, 14

Slide 30

Slide 30 text

rebase or no? • Prefer rebase • this keeps the commit log cleaner •git pl • Sometimes an actual merge is needed • So don’t rebase • For example, when merging branches Sunday, May 25, 14

Slide 31

Slide 31 text

git push Sunday, May 25, 14

Slide 32

Slide 32 text

Git for SVN Sunday, May 25, 14

Slide 33

Slide 33 text

Git for SVN Sunday, May 25, 14

Slide 34

Slide 34 text

Git for SVN Sunday, May 25, 14

Slide 35

Slide 35 text

Git Lifecycle Sunday, May 25, 14

Slide 36

Slide 36 text

The Staging Area (AKA The Index) Sunday, May 25, 14

Slide 37

Slide 37 text

.gitignore Sunday, May 25, 14

Slide 38

Slide 38 text

Learning More Sunday, May 25, 14

Slide 39

Slide 39 text

Bonus: zsh integration Sunday, May 25, 14

Slide 40

Slide 40 text

Not Today: Branching Sunday, May 25, 14

Slide 41

Slide 41 text

Totango Links • Wiki: https://sites.google.com/a/ totango.com/wiki/engineering/git • Repo: https://github.com/totango/main • CI: TODO Sunday, May 25, 14

Slide 42

Slide 42 text

References http://git-scm.com/about http://thkoch2001.github.io/whygitisbetter/ http://www.slideshare.net/manishchaks/subversion- to-git-migration http://www.git-tower.com/blog/git-for-subversion- users-cheat-sheet-detail/ http://git.or.cz/course/svn.html AKA where did I steal from? Sunday, May 25, 14