Your SlideShare is downloading. ×
0
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- hard...
Face it, here is what happens ifyou merge blindly- your history becomes a mess- you hide information in mergecommits- hard...
make the console your friend//commit ALL THE THINGS for fuck sake!git config --global alias.ca !git add -A && git commit//...
Useful links!http://www.randyfay.com/node/91http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-que...
Get in touch.http://twitter.com/cburgdorfhttps://github.com/cburgdorf
Upcoming SlideShare
Loading in...5
×

Advanced git features

790

Published on

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
790
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Advanced git features"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×