CS FundamentalsHardProduct-company MCQ pattern
When does git merge feature (run on main) produce a fast-forward instead of a merge commit?
- A. When main has no new commits since feature branched off, so main can simply move its pointer to feature's tip
- B. When both branches changed different files
- C. Only when the --no-ff flag is given
- D. When feature has only one commit
Correct answer: A. When main has no new commits since feature branched off, so main can simply move its pointer to feature's tip
If main's tip is an ancestor of feature's tip, Git just advances the main pointer (no merge commit). Different files changed on both sides still needs a true merge commit; --no-ff forces a merge commit.
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
- A stock-price service must notify every registered display widget whenever the price changes, without knowing the widgets' concrete…
- Your application expects a PaymentGateway interface, but the third-party library you must use exposes a different API. Which pattern lets…
- class Square extends Rectangle overrides setWidth() so that it also changes the height. Code that sets width = 5 and height = 4 on a…
- A ReportService creates a new MySqlDatabase() directly inside its constructor. Refactoring it to receive a Database interface through its…
- Which HTTP method is NOT idempotent by definition?
- A logged-in user with a valid token calls an admin-only API endpoint. Which status code should the server return?