CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE
A long-lived feature branch has fallen far behind main, and its author wants a clean, linear history without the clutter of many intermediate merge commits, and is comfortable rewriting their own branch's history before opening a pull request. Which approach fits best?
- A. Merge main into the feature branch repeatedly without ever rebasing
- B. Cherry-pick every single commit from main onto the feature branch by hand
- C. Delete the feature branch and start over from scratch each time
- D. Interactively rebase the feature branch onto the latest main, then force-push the rebased branch (a safe operation here since no one else has based work on it)
Correct answer: D. Interactively rebase the feature branch onto the latest main, then force-push the rebased branch (a safe operation here since no one else has based work on it)
Rebasing onto the latest main gives a clean, linear history as if the feature had been built on the current tip all along; force-pushing is acceptable specifically because the branch is not yet shared with collaborators who have based work on the old commits.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Two components with availability 99.0% and 98.0% are connected in series (the system works only if both are up). What is the system's…
- A control-flow graph has 14 edges, 8 nodes and 1 connected component. Using V(G) = E − N + 2P, what is its cyclomatic complexity?
- A PERT activity has optimistic time 2 days, most likely time 6 days and pessimistic time 9 days. What is its expected duration, Te = (O +…
- A developer deploys application code to a managed platform (e.g. a managed app-hosting service) that automatically handles the underlying…
- In a UML class diagram, a solid diamond at one end of an association line represents:
- A system's acceptance testing is performed by actual end users in their own real environment, before general release. This is: