Getting intimate with Git

Post on 11-Feb-2017

136 views 0 download

transcript

Getting intimate with

the stupid content tracker

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

VCSNo more:

- “who overwrote my changes”

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

that’s out of date”

Enter gitputting “distributed” into DVCS, kinda

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

and yet…

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

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

Gitology

Getting dirty

• Commits

• Branches

• Merging work

• Rebase

• Restoring “lost” content

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

Branches

• Just a pointer

• Different from a workflow “branch”

• The tracking branches

Merging work

• Default behaviour

• Fast-forward

• no-commit and no-ff

Rebase

• Why you should not bother

Recovering “lost” work

• reflog

• git gc

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

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