CS FundamentalsHardInfosys · Product placement
Assertion (A): You should not rebase commits that others have already based work on. Reason (R): Rebasing creates new commits with new hashes, so collaborators' histories diverge from the rewritten branch.
- A. A is true but R is false
- B. A is false but R is true
- C. Both A and R are true, but R does not explain A
- D. Both A and R are true and R explains A
Correct answer: D. Both A and R are true and R explains A
Because rebased commits are new objects, anyone who built on the old ones now has duplicates and messy merges. That is exactly why rebasing is reserved for unpublished or private branches.
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
- You run git branch -d experiment and Git refuses: 'the branch is not fully merged'. You force it with git branch -D. Which statement is…
- While running git rebase main on your feature branch, a conflict appears. In this situation, what do git checkout --ours and --theirs…
- A feature branch is merged into main with git merge --no-ff feature, although main had not moved since feature branched. What is the result?
- A developer wants to find out which commit introduced the string 'legacyPay(' anywhere in the code base, even though the commit messages…
- What does this Prototype-style code print? python import copy class Doc: def init(self, title, tags): self.title = title self.tags = tags…
- What does this Decorator-pattern code print? python class Coffee: def cost(self): return 50 def desc(self): return "coffee" class AddOn…