CS FundamentalsHardGATE CS · TCS NQT Prime · Product Company SDE
What does `git commit --amend` do?
- A. Creates a brand-new commit on top, leaving the previous one untouched
- B. Replaces the most recent commit with a new one that includes any newly staged changes and/or an edited commit message, effectively rewriting that last commit
- C. Permanently deletes the most recent commit with no replacement
- D. Pushes the amended commit automatically to the remote
Correct answer: B. Replaces the most recent commit with a new one that includes any newly staged changes and/or an edited commit message, effectively rewriting that last commit
Amend folds currently staged changes (and/or a new message) into the tip commit by replacing it with a new commit object; because this changes the commit's hash, it should be avoided on commits already shared with others.
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
- For a organic mode project with Basic COCOMO effort E = 55.8 person-months, the development time formula is D = 2.5 × E^0.38 months. What…
- A third-party payment gateway's SDK exposes an interface completely incompatible with the shape your application's PaymentProcessor…
- A microservice architecture replaces a single large monolith with many small, independently deployable services. Which of these is a…
- What is the safest way to undo the effect of a single bad commit that is already on a shared branch other people have pulled?
- Which SDLC model is characterised by delivering the product in a series of small, usable, incrementally growing releases, each adding new…
- What is the key practical drawback of the waterfall model that iterative models (incremental, spiral, Agile) were designed to address?