• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Git: Beyond the Basics
 

Git: Beyond the Basics

on

  • 451 views

Git Beyond the Basics with John Bohn ...

Git Beyond the Basics with John Bohn

One thing that makes git a great version control systems is its low barrier to entry, but there's so much more to learn. We'll start with a very brief intro to git and quickly move onto some more fun and advanced topics such as recovering lost commits, rebasing, bisecting, bookmarking and more. Come learn some valuable tips and tricks that are sure to same you time and headaches.

A second generation developer working at OpenSky, John Bohn is an open source contributor and advocate of anything that gets the job done better and faster.

Statistics

Views

Total Views
451
Views on SlideShare
450
Embed Views
1

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 1

http://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Git: Beyond the Basics Git: Beyond the Basics Presentation Transcript

    • git beyond the basicsThursday, August 2, 12
    • John Bohn @jjbohnThursday, August 2, 12
    • Developer at OpenSky curated social commerceThursday, August 2, 12
    • what is gitThursday, August 2, 12
    • git is fast and lightweight free/open source distributed crazy simpleThursday, August 2, 12
    • init branch add commit mergeThursday, August 2, 12
    • Almost any VCS works does this (more or less) What is special about git?Thursday, August 2, 12
    • InteractivityThursday, August 2, 12
    • git add --patch git add --interactiveThursday, August 2, 12
    • Arduino ExampleThursday, August 2, 12
    • Change BlinkThursday, August 2, 12
    • Change Blink - Two logical changes - Don’t want to bother undoing one - Can’t git add . or git add [file]Thursday, August 2, 12
    • git add --patchThursday, August 2, 12
    • git add --patchThursday, August 2, 12
    • git add --patchThursday, August 2, 12
    • git add --patch Commit the changeThursday, August 2, 12
    • git add --patch Stage other changes Diff is now empty (everything is staged or commited)Thursday, August 2, 12
    • git stashThursday, August 2, 12
    • is super boringThursday, August 2, 12
    • until you throw some flags at it...Thursday, August 2, 12
    • My Favorites git stash --no-keep-index git stash --keep-index git stash --include-untracked git stash --patchThursday, August 2, 12
    • Finding these commands is just a matter of diggingThursday, August 2, 12
    • git anything --helpThursday, August 2, 12
    • git reset is not git revertThursday, August 2, 12
    • git reset --soft [sha] git reset --hard [sha] git reset --mixed [sha]Thursday, August 2, 12
    • You can also: git reset --patch (but not with those modes)Thursday, August 2, 12
    • Bisecting aka: Finding a commit that screwed things up.Thursday, August 2, 12
    • BisectingThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 6 Commits - One Bug We know that 7b35b is good We know that cfc332 is bad But we have no idea where the bug was introducedThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good bad Tell git what is known good and badThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good badThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good good badThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good good good badThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good good good bad 2ab1f is most likely good because the commit after it isThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good good good bad badThursday, August 2, 12
    • Bisecting 7b35b 2ab1f 9680d 91296 c6d43 cfc332 good good good bad bad badThursday, August 2, 12
    • Recovering lost commitsThursday, August 2, 12
    • git reflogThursday, August 2, 12
    • git reflog Technically shows any action where the tip of a branch is modified git reflog --all shows stashes, bisects, etc.Thursday, August 2, 12
    • Recovery Let’s say I reset --hard and wiped out the commit that changed my LED to pin 10 Use combination of reflog and cherry-pick to get it backThursday, August 2, 12
    • Recovery Found it! 3ecdba3Thursday, August 2, 12
    • Recovery Double check that 3ecdba3 is really the commit we want git diff 3ecdba3^.. 3ecdba3 Shows me the difference between the commit I want to cherry pick and the commit prior.Thursday, August 2, 12
    • git cherry-pick Now cherry pick 3ecdba3 into our working tree Note: the sha has changed because this commit now has a different parent than it did when it was recorded into the reflogThursday, August 2, 12
    • Recovery Checkout the reflog again to see the cherry-pickThursday, August 2, 12
    • Interactive Rebasing Changing the past one commit at a timeThursday, August 2, 12
    • git rebase -i [commit]Thursday, August 2, 12
    • git rebase -i [commit]Thursday, August 2, 12
    • git rebase -i [commit]Thursday, August 2, 12
    • git rebase -i [commit]Thursday, August 2, 12
    • Interactive rebaseThursday, August 2, 12
    • git internals The plumbing and the porcelainThursday, August 2, 12
    • git internals git stores snapshots, not differences Storing differences is slow and inflexible CVS/Subversion gitThursday, August 2, 12
    • git internals git stores snapshots, not differences Storing differences is slow and inflexible CVS/Subversion gitThursday, August 2, 12
    • git internals What does a commit look like?Thursday, August 2, 12
    • git internals Let’s investigate a repo Sorry for the bad “investigation” image ;-)Thursday, August 2, 12
    • Thanks! Come work with me at OpenSky! We’re HiringThursday, August 2, 12