66. Rebase Feature Branch onto Correct Base
Beginner Mode
Start your terminal to use beginner mode.
Scenario
A Git repository at /home/interview/repo has a feature branch feature-login with several commits, but it was created from the wrong base branch.
Task
Rebase feature-login onto develop (it's currently based on main) while preserving all commits.
Example
# Before (feature branched from main)
* d7e8f9a (develop) Configure database settings
| * c2d3e4f (HEAD -> feature-login) Implement form validation
| * a9b0c1d Create login component
|/
* 3f4a5b6 (main) Initialize repository
# After (feature rebased onto develop)
* m8n9o0p (HEAD -> feature-login) Implement form validation
* k6l7m8n Create login component
* d7e8f9a (develop) Configure database settings
* 3f4a5b6 (main) Initialize repository
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
Linux 0/29
AWS 0/10
Kubernetes 0/15
CI/CD 0/5
Networking 0/9
Need more practice in this area? Explore more questions →
Samsung
Accenture
Coinbase
Adobe
EPAM
Twitch
Amazon
Kayak
Autodesk
Lyft
Revolut
RedHat
Bloomberg
Datadog
Palantir
TCS
HashiCorp
Google
DeutscheBank
GitHub
Apple
Cloudflare
Stripe
Microsoft
NVIDIA
GoDaddy
X
SAP
Spotify
Airbnb
Meta
Reddit
Yelp
Okta
Dropbox
Slack
ActivisionBlizzard
Zscaler
Uber
IBM
DeliveryHero
Robinhood
GitLab
Shopify
Elastic
Twilio
Netflix
CrowdStrike
Ubisoft
Anthropic
Capital One
Splunk
Intel
AMD
Databricks