1. 17
    Practical Git: Clean up commits with git rebase
    5m 42s

Practical Git: Clean up commits with git rebase

Trevor Miller
InstructorTrevor Miller

Share this video with your friends

Send Tweet

Sometimes its nice to clean up commits before merging them into your main code repo; in this lesson, we go over using git rebase to squash commits together and then rename the condensed commit message. We also talk about potential issues with rebasing and where to be careful.

fauno F
fauno F
~ 4 years ago

Does git push --force-with-lease will do a better job?

Trevor Miller
Trevor Millerinstructor
~ 4 years ago

@omar, thanks for the comment. I didn't include it --force-with-lease in this course for two reasons 1) it is only available in later versions of git that not everyone has and 2) in my opinion, you should never use --force except on your own branch that only you are working on, so --force and ---force-with-lease have the same result (since there is nobody else's work that you could possibly override). So, in my mind, ---force-with-lease should never be needed because you shouldn't force a push if it is going to a place where someone else is contributing as well - where history could be damaged. But that's my 2 cents :)