Your SlideShare is downloading. ×
Advanced git features
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Advanced git features

737
views

Published 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

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
737
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
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

×