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

Gitting like a pro - Take 2.pdf

Gitting like a pro - Take 2.pdf

From amateur to Gitting like a pro, to Gitting like a boss :)

Stratos Pavlakis

May 26, 2021
Tweet

More Decks by Stratos Pavlakis

Other Decks in Programming

Transcript

  1. GITTING LIKE A PRO
    Git recipes for healthier coding
    Take 2

    View full-size slide

  2. Who is this guy?
    Stratos Pavlakis
    Head of engineering @Blueground
    https://github.com/th3hunt

    https://twitter.com/th3hunt

    View full-size slide

  3. why should I master Git?

    View full-size slide

  4. The basics
    • Install Git

    • Install Git autocomplete

    • Con
    fi
    gure username & email

    • Con
    fi
    gure editor

    • Con
    fi
    gure rerere

    • Con
    fi
    gure aliases

    View full-size slide

  5. The internals
    • Git is an object database

    • Blobs, Trees, Commits

    • SHA-1

    • Working directory

    • Index (formerly cache)

    • Con
    fi
    gure aliases

    View full-size slide

  6. Git like a pro
    • The conventional commit

    • The linear history

    • One
    fl
    ow branching model

    View full-size slide

  7. Git like a pro
    • git branch -r | -l

    • git add -p

    • git commit -m

    • git commit —amend

    • git log

    • git log —stat

    • git log -p

    • git log —follow

    • git log —graph —short

    • git log foo..bar

    • git re
    fl
    og —relative-date

    • git push

    • git push —force-with-lease

    • git rm —cached

    • git clean

    • git show
    • git di
    ff


    • git di
    ff
    —cached

    • git di
    ff
    —color-moved

    • git di
    ff
    and git apply

    • git con
    fi
    g --global di
    ff
    .colormoved default

    • git stash

    • git stash —keep-index

    • git
    fi
    xup

    • git rebase —autosquash

    • git rebase —onto

    • git rerere

    • git revert

    • git gui

    • gh pr

    • gh repo

    View full-size slide

  8. Git like a boss
    • git grep # for where

    • git log —source -S # for when

    • git bisect # to
    fi
    nd the culprit

    • git worktree # for pomodoro haters

    • git notes

    • grip

    • delta

    View full-size slide

  9. Git wicked
    • git
    fi
    lter-repo

    • git
    fi
    lter-branch

    • git replace

    View full-size slide

  10. Release manager merging a long lived feature branch


    Oil on canvas - 2015

    View full-size slide

  11. Resources
    • Git internals

    • The conventional commit log

    • One
    fl
    ow

    • git-delta


    fi
    xup and autosquash

    • th3hunt’s git aliases

    View full-size slide