Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GIT Fuckups

GIT Fuckups

A presentation about the issues you will probably run into when using GIT. The presentation was for colleagues at @wirelab and some of the content probably won't be relevant to you.

The lesson in short is:
- use terminal
- if you do use a graphical client and it suggests a fix, don't use it if you don't know what it does.
- play with Githug! (https://github.com/Gazler/githug)

Bart van Zon

April 11, 2012
Tweet

More Decks by Bart van Zon

Other Decks in Technology

Transcript

  1. GIT FUCKUPS We all know how GIT is supposed to

    work, but what if it doesn’t? 1
  2. WHAT CAN GO WRONG? • The online repository breaks down

    • Merging issues • Accidental commit • Accidental push • Worked in wrong branch • Lots of other stuff 2
  3. REPO BREAKS DOWN • Not able to pull/push/create repo •

    We’re no sysadmins • Gitorious Github! • Old repo’s available on fileserver/wirelab/gitorious 3 Should be history
  4. MERGING ISSUES • Can GIT merge it for you? •

    Manual merge is a peace of cake with the right tools! • Is it a binary file? (you’re screwed!) • Gitbear/darthvader solves binary issues! 4 Not an issue if you know what to do...
  5. ACCIDENTAL COMMIT • Forgot a file? • There’s an issue

    that should be fixed in this commit? • Typo in commit message? • git commit --amend • Do NOT use after pushing the commit. 5 No problem!
  6. ACCIDENTAL PUSH • git push --force <commit> (dangerous) • Do

    not force push if someone else pushed after you. • git revert <commit> • Want to prevent next time? git config --global push.default tracking 6 Still fixable!
  7. OOPS, WRONG BRANCH • Didn’t commit yet? stash it! •

    Committed or Pushed? as mentioned before then stash. 7 Just copy-paste your changes
  8. OTHER ISSUES • Cheat sheet? • Ask a colleague. •

    Googleable? • Git help? • Stack Overflow it! 8
  9. MAKE LEARNING GIT EASY • Terminal makes understanding GIT easier

    (and looks 1337) • Install “Oh My ZSH” • Play with Githug (github.com/Gazler/githug) 9
  10. MAKE SOLVING ISSUES EASY • Use a descent comparison/merging tool.

    • Read the errors you get! • Tool suggests fix but you don’t know what it is? Don’t do it! 10