Git: a tool for wizards

30
git: a tool for wizards Chris Mangus, MyLife.com [1]
  • date post

    21-Oct-2014
  • Category

    Technology

  • view

    251
  • download

    0

description

Chris gives a great overview of git with a demos including comparisons to other CVS and some tricks at the end

Transcript of Git: a tool for wizards

Page 1: Git: a tool for wizards

git: a tool for wizards

Chris Mangus, MyLife.com[1]

Page 2: Git: a tool for wizards

git is a version control system

What is 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

Page 3: Git: a tool for wizards

Why would you need version control?

● To save older versions of a file● To review past changes● To insure against mistakes● To revert to older versions● To maintain a history● To put a name to who changed what

Page 4: Git: a tool for wizards
Page 5: Git: a tool for wizards
Page 6: Git: a tool for wizards

So, what is git anyway?

git is a distributed version control system, that is open source and made with speed in mind

Page 7: Git: a tool for wizards
Page 8: Git: a tool for wizards

Quick git History

■ Linus Torvalds was using a DVCS named BitKeeper, but then BitKeeper withdrew the free version of its product

■ This inspired Linus to create his own DVCS to keep up with the demands of thousands of people working on the Linux kernel

[2]

Page 9: Git: a tool for wizards

Git and the competitionAnd by competition I mean

SVN and Mercurial

Page 10: Git: a tool for wizards

● Online vs Offline○ No need to get on the company VPN if you only

have to local work. Since git is a full repository locally, you don’t need a network connection to use source control

● Speed● Branching● Ease of Use

Git vs SVN

Page 11: Git: a tool for wizards

Git vs SVN

Data Representation is different as well

Page 12: Git: a tool for wizards

SVN

Git

Page 13: Git: a tool for wizards

Git vs Mercurial (Hg)

● Ease of Use● Flexibility

“Git is MacGyver, and Mercurial is James Bond”

http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/

[4][3]

Page 14: Git: a tool for wizards

One last big benefit of Git...

You get to use Github.com!

Page 15: Git: a tool for wizards

Cool projects on Github

Node.jsjQuerythe Linux KernelRuby on Railsand many many more...

Page 16: Git: a tool for wizards

Basic Git Mechanics~live demo~

Page 17: Git: a tool for wizards

Rebase is neat?

[5]

Page 18: Git: a tool for wizards

Now you can use git by yourself but lets work

with others

Page 19: Git: a tool for wizards

Git Workflows

● SVN style● Integration Manager style● and many many more...

Page 20: Git: a tool for wizards

SVN Style

Page 21: Git: a tool for wizards

Integration Manager style

Page 22: Git: a tool for wizards

There are tools for that

So you think the command line is scary?

Page 23: Git: a tool for wizards

One of the quickest ways to get a GUI with git, is to just type in git gui into your console.

It will pop up a basic GTK GUI to do most things with Git

Git GUI

Page 24: Git: a tool for wizards
Page 25: Git: a tool for wizards

SourceTree

SourceTree is a fantastic full featured GUI client for Git

It surfaces all the major git commands as large buttons so that there is no effort to use Git on a day to day basis.

It also gives great visuals on the history of a Git repository to help find that pesky commit you are looking for

Page 26: Git: a tool for wizards
Page 27: Git: a tool for wizards

Now its time for some tricks?

git diff --name-status master..branchfinds the differences between two named

branches

git log --pretty=onelinegives one line log history that looks great

Page 28: Git: a tool for wizards

Tricks continued

git stash - will save all uncommited changes into the git local repository. you can git stash pop to get these changes back at any time.

git checkout -b branchname hashlets you create and switch to a new branch

with the HEAD placed at the commit referenced by the hash

Page 29: Git: a tool for wizards

Links for more knowledge

http://git-scm.com/

http://github.com

Quick link to the free git bookhttp://git-scm.com/book

Page 30: Git: a tool for wizards

Sources[1]http://postsurf.com/wp-content/uploads/2009/04/artist-unknown-wizard.jpg[2]http://commons.wikimedia.org/wiki/File:Tux.svg[3]http://uploads.neatorama.com/wp-content/uploads/2010/06/macgyver.jpg[4]http://booksdvdsforboys.com/wp-content/uploads/2013/05/bond-brosnan-martini.jpg[5]http://talks.chastell.net/rubyconf-2011/file/me-me-me/git-rebase.pngAll the rest are from the Git book, www.git-scm.com/book