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

Git, Unicorns and Rainbows

ubermuda
October 27, 2011

Git, Unicorns and Rainbows

A small compilation of some git jaw dropping features

ubermuda

October 27, 2011
Tweet

More Decks by ubermuda

Other Decks in Technology

Transcript

  1. git --amend • Add files to a commit • Remove

    files from a commit • Change a commit’s message Wednesday, September 21, 11
  2. git add -p • Stage only the chunks of diff

    you want • Intelligent chunking (chunk more!) • Manual chunk edit Wednesday, September 21, 11
  3. git rebase -i • Change commits order • Edit commits

    (just like commit --amend) • Squash commits together Wednesday, September 21, 11
  4. Work locally! • Commit • Create / merge branches •

    What you can’t do: push and fetch Wednesday, September 21, 11
  5. Branches are cheap • A branch is just a ref

    to a commit • That is, a 40 bytes file • Containing a sha1 Wednesday, September 21, 11
  6. It’s never too late • Mark your current commit •

    Switch back to previous branch • Reset to branch start-point Wednesday, September 21, 11
  7. git bisect • Tell git a commit for which the

    build works • And a commit for which it’s broken • It will find the commit that breaks! Wednesday, September 21, 11
  8. git filter-branch • Crawls your history • Runs commands on

    it • And voila! Wednesday, September 21, 11