Gitting better

Improving your Git skills

Matt Peperell

@mattpep

https://slides.com/mattpep/gitting-better/

getting bitter

Format of

this talk / workshop

Estimated duration: 90 minutes

https://slides.com/mattpep/gitting-better/

Content

  • Ignore this
  • Remotes
  • Identifying commits
  • The reflog
  • Merging, resolving conflicts
  • Rebasing
  • Index, stash, bisect
  • Hook scripts
     
  • Objects and packfiles

But first...

A recommended local alias

$ cat ~/.gitconfig
[alias]
lg = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative

Ignoring things

$ cat .gitignore 
*.tmp

Remotes

Why do I push and pull?

Remotes

More than one remote?

Identifying commits

  • SHA
  • Tag name
  • Branch name
  • HEAD
  • Remote branches
  • Tilda rice and carrots

The reflog

Merging

on the command line

Resolving conflicts

git rebase

surgery on your tree

git rebase

interactive

$ git rebase -i HEAD^^^^

The index

git stash

git bisect

Finding when a bug was introduced

Hook scripts

Git objects

cat-file and friends

Thank you

Gitting better

By Matt Peperell

Gitting better

  • 222