Intro to Git

33
Introduction to Git OJ Tibi <[email protected]> Saturday, June 18, 2011 Greets to all. Ask how many have used Git, of any other RCS, CVS, SVN, etc.

description

A short introduction to Git, hopes to inspire people to use this wonderful distributed RCS.

Transcript of Intro to Git

Page 1: Intro to Git

Introduction to GitOJ Tibi <[email protected]>

Saturday, June 18, 2011

Greets to all.Ask how many have used Git, of any other RCS, CVS, SVN, etc.

Page 2: Intro to Git

About Me

• Ex-ninja of PoliticalArena.com and newbie warrior at Shopinas.com

• 3+ years enjoying CakePHP

• Fedora fan

Saturday, June 18, 2011

Short description about the author of the presentation.

Page 3: Intro to Git

What is Git?

Saturday, June 18, 2011

Git is a distributed revision control system (RCS). An RCS is a kind of software that tracks changes on files that are in a certain repository. “Distributed” describes how Git does not need a central server to record changes on the said repository.

Page 4: Intro to Git

Saturday, June 18, 2011

Short information about Linus Torvalds and on creating Git.Linus (and the Linux project) needed a new RCS after BitKeeper became non-free.Linus found that current SCMs lack performance, decided to make Git.

Page 5: Intro to Git

Saturday, June 18, 2011

Short information about Linus Torvalds and on creating Git.Linus (and the Linux project) needed a new RCS after BitKeeper became non-free.Linus found that current SCMs lack performance, decided to make Git.

Page 6: Intro to Git

Saturday, June 18, 2011

Short information about Linus Torvalds and on creating Git.Linus (and the Linux project) needed a new RCS after BitKeeper became non-free.Linus found that current SCMs lack performance, decided to make Git.

Page 7: Intro to Git

Saturday, June 18, 2011

Short information about Linus Torvalds and on creating Git.Linus (and the Linux project) needed a new RCS after BitKeeper became non-free.Linus found that current SCMs lack performance, decided to make Git.

Page 8: Intro to Git

Git is...• A distributed revision

control system

• Created by Linus Torvalds and Junio Hamano

• Independent of network access or a central server (reminds you of SVN, huh?)

Saturday, June 18, 2011

Short description about Git.

Page 9: Intro to Git

Who Uses Git?

Saturday, June 18, 2011

List of companies or projects that use Git, starts with Twitter...

Page 10: Intro to Git

Saturday, June 18, 2011

...Facebook, and CakePHP as examples of projects that use Git.These projects and companies rely on the fast, independent, distributed nature of Git.

Page 11: Intro to Git

Saturday, June 18, 2011

...Facebook, and CakePHP as examples of projects that use Git.These projects and companies rely on the fast, independent, distributed nature of Git.

Page 12: Intro to Git

Saturday, June 18, 2011

...Facebook, and CakePHP as examples of projects that use Git.These projects and companies rely on the fast, independent, distributed nature of Git.

Page 13: Intro to Git

Saturday, June 18, 2011

...Facebook, and CakePHP as examples of projects that use Git.These projects and companies rely on the fast, independent, distributed nature of Git.

Page 14: Intro to Git

Where to Use Git?

Saturday, June 18, 2011

Following is a list of file types where one may consider putting into an RCS, specifically Git.

Page 15: Intro to Git

Saturday, June 18, 2011

Source code, talk about kinds of source code (HTML5, CSS3, PHP, Python, Ruby, JS)“Projects like the web site of a multinational company that hopefully wouldn’t get hacked again and again...”

Page 16: Intro to Git

Saturday, June 18, 2011

PDFs, text documents, spreadsheets, presentationsNext: images (binaries)

Page 17: Intro to Git

Saturday, June 18, 2011

PDFs, text documents, spreadsheets, presentationsNext: images (binaries)

Page 18: Intro to Git

Saturday, June 18, 2011

PDFs, text documents, spreadsheets, presentationsNext: images (binaries)

Page 19: Intro to Git

Saturday, June 18, 2011

PDFs, text documents, spreadsheets, presentationsNext: images (binaries)

Page 20: Intro to Git

Saturday, June 18, 2011

Images (and some binaries), YMMV, as not all images are recommended to be kept inside source control. Most projects need images, so you might want to count them in. SVG illustrations, PNG icons, GIF diagrams of your corporate network, JPG photos and even sometimes PSDs... just to make sure you can roll back to something in case you need to make some edits. :)

Page 21: Intro to Git

Saturday, June 18, 2011

Images (and some binaries), YMMV, as not all images are recommended to be kept inside source control. Most projects need images, so you might want to count them in. SVG illustrations, PNG icons, GIF diagrams of your corporate network, JPG photos and even sometimes PSDs... just to make sure you can roll back to something in case you need to make some edits. :)

Page 22: Intro to Git

Saturday, June 18, 2011

Images (and some binaries), YMMV, as not all images are recommended to be kept inside source control. Most projects need images, so you might want to count them in. SVG illustrations, PNG icons, GIF diagrams of your corporate network, JPG photos and even sometimes PSDs... just to make sure you can roll back to something in case you need to make some edits. :)

Page 23: Intro to Git

Saturday, June 18, 2011

Images (and some binaries), YMMV, as not all images are recommended to be kept inside source control. Most projects need images, so you might want to count them in. SVG illustrations, PNG icons, GIF diagrams of your corporate network, JPG photos and even sometimes PSDs... just to make sure you can roll back to something in case you need to make some edits. :)

Page 24: Intro to Git

Saturday, June 18, 2011

Images (and some binaries), YMMV, as not all images are recommended to be kept inside source control. Most projects need images, so you might want to count them in. SVG illustrations, PNG icons, GIF diagrams of your corporate network, JPG photos and even sometimes PSDs... just to make sure you can roll back to something in case you need to make some edits. :)

Page 25: Intro to Git

Getting Git

Saturday, June 18, 2011

Explain the methods how Git can be obtained.

Page 26: Intro to Git

Git It Here• *Nix

• yum install git

• apt-get install git-core

• http://git-scm.com/download

• Mac

• http://code.google.com/p/git-osx-installer/

• http://git-scm.com/download (build it, old-school)

• http://macports.org/

• PC

• http://code.google.com/p/msysgit

Saturday, June 18, 2011

*Note: Didn’t include Cygwin because it’s kinda bloated.

Page 27: Intro to Git

Basic Git Workflow

Saturday, June 18, 2011

To work effectively using Git...

Page 28: Intro to Git

“init” or “clone” a repo make changes

“add” and “commit” your changeset

“pull” changes from remote

“merge” conflicts, if any

“push” changes to remote

“tag” a version for release

“format-patch” for submission

Saturday, June 18, 2011

A basic understanding of a Git workflow. Unlike SVN, Git needs an additional step to “push” changes from the local repository to the remote repository.

Page 29: Intro to Git

“format-patch” what?!?

• git format-patch enables the user to create patches that can be sent via e-mail.

• Was useful for Linux kernel devs, reviewing code in small teams.

Saturday, June 18, 2011

format-patch lets the user make patches that can be submitted via electronic mail.site how Linux devs review the code by peers before submitting to the main repository.

Page 30: Intro to Git

Share Your Code!

• “git format-patch” old-skool, but effective for peers

• “git push” to a remote repository

• it, or try

Saturday, June 18, 2011

Offer some choices on how to share a Git repository.

Page 32: Intro to Git

~Fin~Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.  ~ Martin Golding

Saturday, June 18, 2011

That concludes the introduction to Git. I hope you had some insight and use it for your projects.

Page 33: Intro to Git

Follow me!http://twitter.com/ojtibi

http://tibi.ph/

Saturday, June 18, 2011

Don’t forget to follow me on Twitter and visit my weblog.

Introduction to Git by OJ Tibi is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.