Advanced git features

  • 658 views
Uploaded on

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
658
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
9
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. advanced™ git featuresand how to survive vim
  • 2. git makes itinsanely git features advanced™ hard and how to survive vim too lose code
  • 3. every commit is a full snapshot!No deltas – for fuck sake
  • 4. A branch is nothing morethan a name for a specific commit
  • 5. the HEAD is just a pointer to where your workingdirectory should currently be on
  • 6. the reflog is a history of all movements of the HEAD
  • 7. commits in the reflog that are not reachable by anybranch will be gc‘ed after 30 days
  • 8. Noticed youare on the wrong branch?
  • 9. git got your back!git checkout –b newBranchgit checkout previousBranchgit reset –hard lastValidCommit
  • 10. ..or relativegit checkout –b newBranchgit checkout previousBranchgit reset –hard HEAD~1
  • 11. “„
  • 12. commit early & oftenyet nobody want‘s to readthis!
  • 13. git rebase –i 6f50a39~1this is what people should see
  • 14. Need the last five commitsfrom branch <foo>without merging anyprevious commits?
  • 15. git cherry-pick first~..last
  • 16. avoid unnecessary merges
  • 17. use a rebase workflow because
  • 18. 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
  • 19. 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
  • 20. 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
  • 21. Useful links!http://www.randyfay.com/node/91http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-questions
  • 22. Get in touch.http://twitter.com/cburgdorfhttps://github.com/cburgdorf