CS FundamentalsVery hardProduct-company placement · Git
On main, git revert HEAD~3..HEAD is run with no conflicts. What happens?
- A. The four commits HEAD~3 to HEAD are reverted, oldest first, in one commit
- B. HEAD~2, HEAD~1 and HEAD are reverted, newest first, one commit each
- C. Only HEAD~3 is reverted, because the range names that commit first
- D. The branch is reset to HEAD~3 and the three later commits are deleted
Correct answer: B. HEAD~2, HEAD~1 and HEAD are reverted, newest first, one commit each
A..B excludes A, so the range is the three commits after HEAD~3. git revert undoes them newest first, which avoids conflicts between dependent changes, adding a new commit for each; nothing is removed from history.
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
- main receives feature work only through merge commits (git merge --no-ff), plus a few direct hotfix commits. What does git log…
- What does this code print (lines joined by ' / ')? python handlers = {'+': lambda a, b: a + b} def fallback(): print('fallback') return…
- A Python app keeps a shared Settings object at module level in settings.py as a singleton. Most code imports it as app.settings, but one…
- What does this code print? python class Count: def init(s, n): s.i = 0; s.n = n def iter(s): return s def next(s): if s.i >= s.n: raise…
- In a strictly layered system, 80% of requests pass through the business and service layers unchanged, which merely forward each call to…
- How many of these are Twelve-Factor App recommendations? 1. Write logs as an event stream to stdout and let the environment route them. 2…