Advanced git features
Upcoming SlideShare
Loading in...5
×
 

Advanced git features

on

  • 911 views

Some useful git fu I put together for a talk targeting my co-workers

Some useful git fu I put together for a talk targeting my co-workers

Statistics

Views

Total Views
911
Views on SlideShare
911
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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

    Advanced git features Advanced git features Presentation Transcript

    • advanced™ git featuresand how to survive vim
    • git makes itinsanely git features advanced™ hard and how to survive vim too lose code
    • every commit is a full snapshot!No deltas – for fuck sake
    • A branch is nothing morethan a name for a specific commit
    • the HEAD is just a pointer to where your workingdirectory should currently be on
    • the reflog is a history of all movements of the HEAD
    • commits in the reflog that are not reachable by anybranch will be gc‘ed after 30 days
    • Noticed youare on the wrong branch?
    • git got your back!git checkout –b newBranchgit checkout previousBranchgit reset –hard lastValidCommit
    • ..or relativegit checkout –b newBranchgit checkout previousBranchgit reset –hard HEAD~1
    • “„
    • commit early & oftenyet nobody want‘s to readthis!
    • git rebase –i 6f50a39~1this is what people should see
    • Need the last five commitsfrom branch <foo>without merging anyprevious commits?
    • git cherry-pick first~..last
    • avoid unnecessary merges
    • use a rebase workflow because
    • Face it, here is what happens ifyou merge blindly- your history becomes a mess- you hide information in mergecommits- harder to do git bisect- harder to do cherry-picking
    • Face it, here is what happens ifyou merge blindly- your history becomes a mess- you hide information in mergecommits- harder to do git bisect- harder to do cherry-picking
    • make the console your friend//commit ALL THE THINGS for fuck sake!git config --global alias.ca !git add -A && git commit//we don‘t need a gui log! git config --global alias.lg log --pretty=oneline --abbrev-commit --graph --decorate
    • Useful links!http://www.randyfay.com/node/91http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-questions
    • Get in touch.http://twitter.com/cburgdorfhttps://github.com/cburgdorf