Skip to content

stevenwilkin/fear-and-loathing-with-git-rebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fear and Loathing with git rebase

Git is not Subversion, we are free to rewrite history any way we see fit which is important when producing atomic commits and when we want our sequence of commits to tell a story.

Many people are either unaware that this is possible or are afraid to do but the basics are straightforward to understand.

In this talk I demonstrate my 5 most common use cases for git rebase. Each scenario has a corresponding bash script which sets up a git repository under repo/ ready to show the technique in action.

fixup

One of my favourites, allows you to fixup an existing commit

git commit --fixup=HEAD
git rebase -i HEAD^^ --autosquash

squash

Similar to fixup but you can squash together any number of arbitrary commits and then edit the message of the resulting commit

git rebase -i HEAD^^

reorder

Simply allows you to reorder a set of commits

remove

Allows you to remove a commit, good for when you've accidentally committed something you shouldn't have

reword

Allows you to reword the message of a commit

About

A lightning talk on git rebase I gave at MAS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages