CS FundamentalsVery hardProduct-company placement · Git interview
While running git rebase main on your feature branch, a conflict appears. In this situation, what do git checkout --ours and --theirs refer to?
- A. --ours is the main side (the base being rebased onto) and --theirs is your feature commit being replayed
- B. --ours is always your feature branch and --theirs is main, as in a merge
- C. Both refer to the common ancestor
- D. --ours is the remote and --theirs is the local branch
Correct answer: A. --ours is the main side (the base being rebased onto) and --theirs is your feature commit being replayed
A rebase replays your commits onto main, so HEAD is the rebuilt main-based history ('ours') and the commit being applied is 'theirs'. This is the reverse of what people expect from git merge on their own branch.
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 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…
- What does this Chain of Responsibility code print? python class Handler: def init(self, limit, name, nxt=None): self.limit, self.name…
- What does this Singleton implemented with a metaclass print? python class Meta(type): inst = {} def call(cls, a, k): if cls not in…