Share
Embed
The Octocat and You: Working with Git
Bryce "BonzoESC" Kerley
July 13, 2011
Transcript
63 slides
-
The Octocat And You Working with Git Design Miami July
13, 2011 Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
Git History Wednesday, July 13, 2011 Linux is a piece
of computer software worked on by tens of thousands of people around the globe. These changes need to be collected, tracked, merged, and combined into one canonical piece of software. With this kind of model, a Distributed Version Control System (DVCS) is needed. I’ll explain what this means later. Originally, a tool called BitKeeper was used, but it wasn’t free enough for everyone, and there was a call from the community to replace it. -
Git History Wednesday, July 13, 2011 Linus Torvalds, the original
author and Benevolent Dictator for Life of Linux, decided to make one that he would like. -
Git History •Distributed •Fast •Support patches by email •Fast •Resistant
to corruption •Fast •Easy to Automate •Fast Wednesday, July 13, 2011 Distributed - you don’t need network access to work, and there’s no central server that has to know about every operation Fast - this means the network doesn’t slow you down, and working over modem isn’t frustrating Support patches by email - you can connect, blast out patches, take in patches, and disconnect Fast - this means that you’re only limited by your mail server, not somebody’s git server hosted on their cable modem Resistant to corruption - each commit refers to the entire history of files and commits that it depends on with a cryptographic hash Fast - this also helps the storage and networking parts Easy to automate - git was originally more of a “version control construction kit” than a big system; it was useful within a week of when it was first started, and has got consistently better as it got wrapped up in more automation Fast - the simple parts are still simple and fast -
Wednesday, July 13, 2011 The biggest boost for Git was
the GitHub service. GitHub’s original tagline was “Git Hosting: no longer a pain in the ass;” an important distinction from all the other ways to host Git in 2008. The three founders of Git used a short closed beta to get some buzz in the Ruby on Rails community, provide free hosting for open-source projects, and paid hosting for closed-source projects. -
Why Git? •All the cool projects are doing it •Fast
•GitHub works well •Fast •Cross-platform •Well-documented Wednesday, July 13, 2011 I thought I got rid of those -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
What Is Git? •Filesystem / “object database” •Snapshots of versions
•Network protocols •A set of small tools Wednesday, July 13, 2011 A filesystem where each file is named after what’s in them; this means that objects with different names but the same contents are only stored once Git doesn’t actually store “sets of changes” in a useful fashion; it stores snapshots since this makes tools easier to write. The storage/networking backend compresses these snapshots into changesets, but it’s not important to understand this at all. Git has three simple network protocols; you’ll only use one or two of them on a daily basis. Git is a bunch of small tools; “plumbing” tools are things you don’t care about unless you are a serious repo janitor, “porcelain” tools are how you actually manipulate the repository, and GUI tools are generally a friendly face for the porcelain. -
Branch Pointer to a commit Not stored in the object
database Wednesday, July 13, 2011 -
Tag Pointer to a commit Can be cryptographically signed Stored
in the object database Wednesday, July 13, 2011 -
Commit Stored in the object database Points to parent commit(s)
Points to a tree Has author and timestamps Think of it as a snapshot Wednesday, July 13, 2011 -
Tree Directory Stored in object database Stores pointers to trees
(subdirectories) and blobs Wednesday, July 13, 2011 -
Pack Collection of compressed objects Used internally for storage and
networking Wednesday, July 13, 2011 -
Installing Git Windows: http://git-scm.com/ Mac: http://git-scm.com/ Linux: sudo aptitude install
git-core Wednesday, July 13, 2011 -
New Repository git init Add File git add pages/index.html.haml Commit
git commit Commit but more convenient git commit -m “added blink tags” pages/index.html.haml Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
My Design Workflow Make mock-up in head, paper, or program
Don’t keep it in a repository Wednesday, July 13, 2011 -
My Design Workflow Write a test Commit Pass the test
Commit Wednesday, July 13, 2011 -
New Branch git checkout -b branchname Change Branch git checkout
master Merge Branch git merge branchname Delete Branch git branch -d branchname Wednesday, July 13, 2011 -
My Design Workflow 1.Mock up outside of repository 2.Create skeleton
repository 3.Make change 4.Commit change 5.Push to server sometimes Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
Mock-ups and PSDs Make mock-up in head, paper, or program
Don’t keep it in a repository Wednesday, July 13, 2011 -
Mock-ups and PSDs Paper sketches Sketches are quick, dirty, and
cheap and that's exactly how you want to start out. Draw stuff. Scrawl stuff. Boxes, circles, lines. Get your ideas out of your head and onto paper. The goal at this point should be to convert concepts into rough interface designs. This step is all about experimentation. There are no wrong answers. 37signals, “Getting Real” Chapter 6, “From Idea to Implementation” Wednesday, July 13, 2011 -
But This PSD Is Sliced Put it in the repository:
+ single point of truth - repository grows quickly with each change Wednesday, July 13, 2011 -
But This PSD Is Sliced Leave it out of the
repository: + repository stays smaller - where did I put it again? Wednesday, July 13, 2011 -
Growing Repository Every copy of your project should include the
whole repository Deleted files still take up space If you change that 30MB PSD in every commit… Wednesday, July 13, 2011 -
A Plea and Idea Small files are better when they
change Big files are better when they don’t Image compositions (PSDs) change Image compositions should be a directory of small files Wednesday, July 13, 2011 We see the “database of small files” approach -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
Git-Svn Fast local branching Fast local commits Predictable local merging
Minimized server interaction Wednesday, July 13, 2011 -
Clone Repo git svn clone http://url.to.repository/ Commit git commit -m
“added marquee tags” pages/index.html Update git svn rebase Push git svn dcommit Wednesday, July 13, 2011 -
Git-Svn The first clone is slow Subversion isn’t designed to
send the entire history all at once Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
Code Hosting GitHub free public paid private on public internet
Wednesday, July 13, 2011 -
Code Hosting gitosis & gitweb free tools you configure it
wherever you want it Wednesday, July 13, 2011 -
Code Hosting girocco or gitorious free tools you configure it
wherever you want it Wednesday, July 13, 2011 -
Code Hosting bananajour free tool little configuration peer to peer
Wednesday, July 13, 2011 -
The Octocat and You •Git History •Git Objects •My Workflow
•GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011 -
Resources gitweb - http://bit.ly/dmcgitweb gitosis - http://bit.ly/dmcgitosis girocco - http://bit.ly/dmcgirocco
gitorious - http://bit.ly/dmcgitorious bananajour - http://bit.ly/dmcbananajour Wednesday, July 13, 2011