Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 1.78 KB

notes-3.md

File metadata and controls

72 lines (53 loc) · 1.78 KB

Webdev — Git 2018 p.3

Rebase
“Junior programmer's first git rebase –interactive“ - Salvador Dalí, 1936, Oil on Canvas, stolen from @vojtatranta and classicprogrammerpaintings.com.

Intro

  • webdev
  • summary

Recap

  • branches

  • merging

  • rebasing

  • remotes

  • man pages!

Commit amend

  • git commit --amend

  • git commit --amend --no-edit

  • push

  • push --force

  • push --force-with-lease

Rebase -i

"Polish a feature branch, clean quick/bulk commits, fast fixes, fixups, review history.

  • git rebase origin/master
  • git rebase -i origin/master
  • git rebase -i origin/master --exec "echo test pass"
  • git rebase -i /hash/
  • git rebase -i HEAD~4
  • git rebase -i /hash/ --onto origin/master

Instructions

  • p, pick
  • r, reword
  • e, edit
  • s, squash
  • f, fixup
  • x, exec
  • d, drop

Navigation

  • skip
  • continue
  • abort
  • edit todo
  • autosquash

More examples

  • split commit to multiple
  • onto
  • force-with-lease config
  • fm, ri, rs, ra, fp config
  • pushed branch + rebase fails
  • conflicts during rebase (rebase feature onto master frequently!)
  • lost commits (dropped, badly resolved conflicts, -> reflog)

Exec examples