git interactive rebase - Undo, Edit & Squash git commits with a single command

Опубликовано: 17 Июнь 2024
на канале: Philomatics
21,192
1k

git rebase --interactive lets you undo, edit, squash and delete commits.

If you like my style of teaching, I'd love to see you at a workshop!
https://philomatics.com/git-workshop/

My other video on git rebase
   • git rebase - Why, When & How to fix conflicts  

Fixing merge conflicts:
   • Never fear merge conflicts again - git mer...  

Video on `git pull --rebase`:
   • Never* use git pull  

How to change your default editor in git:
   • My most used git aliases  

Use the following command to change your default editor to VSCode:

git config --global core.editor "code --wait"

If you use a different editor, just Google "git set text editor to $yourEditor", it's usually easy to find.

Git Graph Extension for VSCode:
https://marketplace.visualstudio.com/...

If you don't use VSCode, you can also use SourceTree, which is free.
https://www.sourcetreeapp.com/

0:00 - What can you do with interactive rebase?
0:27 - Editing a commit
4:14 - Splitting a commit
5:34 - Squashing commits
6:15 - Deleting and reordering commits
6:29 - Undoing a rebase
6:49 - Dealing with conflicts
7:10 - git cheatsheet

Thank you to Serhat Güler and Ben Freundorfer for giving great feedback on drafts of this video!

LEGAL DISCLAIMER
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Everything here is for informational purposes only. All non-licensed clips used for fair use commentary, criticism, and educational purposes. See Hosseinzadeh v. Klein, 276 F.Supp.3d 34 (S.D.N.Y. 2017); Equals Three, LLC v. Jukin Media, Inc., 139 F. Supp. 3d 1094 (C.D. Cal. 2015).