EasyEnv
Git
BeginnerLesson 7 of 1330 min · hands-on

Rebasing

Part of the Git course

You branched off main on Monday to add a search box. It is now Thursday, you have three commits, and in the meantime four other people have pushed to main. Your branch is built on a version of the project that no longer exists anywhere. Before your work can join main, those two lines of history have to be brought back together, and Git gives you two different ways to do it.

The first is a merge, which records the truth: two lines of work existed side by side, and here is the commit where they came together. The second is a rebase, which rewrites your side of the story so it looks like you started your work this morning, from the current tip of main. Merge is honest about what happened. Rebase is tidy about what it leaves behind. ...

Want to learn Git Rebasing in a real environment?

Click below, get a fresh Linux box with Git ready to go, and work through Rebasing hands-on with an AI tutor that knows your code.

Start this lessonRebasing

What you'll learn

  • Git rebase
  • Replay on top
  • Linear history
  • When not to rebase

Read this lesson in your language

All lessons in this course

13 lessons
  1. 1Init and Your First Commit25 min
  2. 2Status, Diff, and Log25 min
  3. 3Branches and Merging30 min
  4. 4Resolving Merge Conflicts30 min
  5. 5Remotes: Push, Pull, Fetch30 min
  6. 6Stash and Cherry-pick25 min
  7. 7Rebasing30 min
  8. 8Interactive Rebase and Squashing30 min
  9. 9Tags and Releases20 min
  10. 10Branching Workflows20 min
  11. 11Recovering Lost Work25 min
  12. 12Hooks25 min
  13. 13Capstone: A Full Pull Request Flow40 min

Explore other courses

Rebasing - Git (English) | Engineering Courses