Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Octocat and You: Working with Git

The Octocat and You: Working with Git

Bryce "BonzoESC" Kerley

July 13, 2011
Tweet

More Decks by Bryce "BonzoESC" Kerley

Other Decks in Design

Transcript

  1. The Octocat And You Working with Git Design Miami July

    13, 2011 Wednesday, July 13, 2011
  2. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  3. 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.
  4. 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.
  5. 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
  6. 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.
  7. 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
  8. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  9. 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.
  10. Branch Pointer to a commit Not stored in the object

    database Wednesday, July 13, 2011
  11. Tag Pointer to a commit Can be cryptographically signed Stored

    in the object database Wednesday, July 13, 2011
  12. 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
  13. Tree Directory Stored in object database Stores pointers to trees

    (subdirectories) and blobs Wednesday, July 13, 2011
  14. 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
  15. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  16. My Design Workflow Make mock-up in head, paper, or program

    Don’t keep it in a repository Wednesday, July 13, 2011
  17. 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
  18. 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
  19. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  20. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  21. Mock-ups and PSDs Make mock-up in head, paper, or program

    Don’t keep it in a repository Wednesday, July 13, 2011
  22. 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
  23. But This PSD Is Sliced Put it in the repository:

    + single point of truth - repository grows quickly with each change Wednesday, July 13, 2011
  24. But This PSD Is Sliced Leave it out of the

    repository: + repository stays smaller - where did I put it again? Wednesday, July 13, 2011
  25. 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
  26. 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
  27. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  28. Git-Svn Fast local branching Fast local commits Predictable local merging

    Minimized server interaction Wednesday, July 13, 2011
  29. 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
  30. Git-Svn The first clone is slow Subversion isn’t designed to

    send the entire history all at once Wednesday, July 13, 2011
  31. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  32. Code Hosting gitosis & gitweb free tools you configure it

    wherever you want it Wednesday, July 13, 2011
  33. Code Hosting girocco or gitorious free tools you configure it

    wherever you want it Wednesday, July 13, 2011
  34. The Octocat and You •Git History •Git Objects •My Workflow

    •GUI Tools •Big Files •Subversion and Git •Git Hosting Wednesday, July 13, 2011
  35. 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