Getting intimate with Git

16
Getting intimate with the stupid content tracker

Transcript of Getting intimate with Git

Page 1: Getting intimate with Git

Getting intimate with

the stupid content tracker

Page 2: Getting intimate with Git

Agenda

• What is a Version Control System?

• So why is git called the “stupid content tracker”?

• More detailed look at everyday tasks with git

• Word on workflows

Page 3: Getting intimate with Git

VCSNo more:

- “who overwrote my changes”

- “which version of the file are you working on? Noooo

that’s out of date”

Page 4: Getting intimate with Git

Enter gitputting “distributed” into DVCS, kinda

• most popular VCS • at heart of the biggest open source community • legendary creator, very competent community

and yet…

Page 5: Getting intimate with Git

Bit of history• Linus Torvalds starts Linux kernel dev in 1991

• “how card can it be to port Unix”

• Becomes biggest open source project in history, still going strong after 25 years

• No VCS solution available for such a big project

• git dev starts in 2005, by a guy heavily into micro-optimisation and not at all into UX

Page 6: Getting intimate with Git

What does it mean?

• Beautiful example of real world optimisation • Putting developers needs first

• Best DVCS is ironically offline • Really fast, scales up to the biggest projects • “The UI is horrible” doesn’t even begin to describe the

awfulness

Page 7: Getting intimate with Git

Gitology

Page 8: Getting intimate with Git
Page 9: Getting intimate with Git

Getting dirty

• Commits

• Branches

• Merging work

• Rebase

• Restoring “lost” content

Page 10: Getting intimate with Git

Commits• Index sucks, don’t use it

• Commits are immutable and include commiter info and timestamp

• Same snapshot can have two different commits

• git can’t decide whether commits should be quick or really detailed

• provides facilities for both

Page 11: Getting intimate with Git

Branches

• Just a pointer

• Different from a workflow “branch”

• The tracking branches

Page 12: Getting intimate with Git

Merging work

• Default behaviour

• Fast-forward

• no-commit and no-ff

Page 13: Getting intimate with Git

Rebase

• Why you should not bother

Page 14: Getting intimate with Git

Recovering “lost” work

• reflog

• git gc

Page 15: Getting intimate with Git

What’s your workflow?• Good tool is just part of the story

• Quite easy to fall into a waterfall-like model despite “best practices”

• http://whilefalse.blogspot.de/2013/02/branching-is-easy-so.html

• git allows workflows that work just for you to work in collaboration with others

Page 16: Getting intimate with Git

Links• Best git tutorial

• https://www.atlassian.com/git/tutorials/

• Gitology explained

• http://jordi.inversethought.com/blog/on-gitology/

• git, the good parts

• http://lucumr.pocoo.org/2015/2/17/ui-and-hidden-consistency/

• Torvalds on git and others

• https://www.youtube.com/watch?v=MShbP3OpASA

• https://www.youtube.com/watch?v=4XpnKHJAok8