Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Situation: # main: A - B - C - D # feature: E - F # After: git switch feature && git rebase main # main: A - B - C - D # feature: E' - F' (new commits with new hashes) git switch feature/user-login git rebase main # If conflicts occur during rebase: # 1. Fix the conflict in the file # 2. Stage the fix: git add src/auth.js # 3. Continue the rebase: git rebase --continue # or abort and go back to the original state: git rebase --abort # After rebasing, force-push to update your PR branch # (safe when only you use the branch): git push --force-with-lease origin feature/user-login # --force-with-lease is safer than --force: # it fails if the remote has changes you haven't seen. # Rebase vs Merge: # Merge — preserves full history, adds merge commits # Rebase — creates clean linear history, rewrites hashes
Result
Open