200-901 · Question #266
A developer is working on a feature for a new application. The changes in the existing branch named 'feat00304' must be integrated into a single commit with the current working primary branch named…
The correct answer is B. git merge --squash feat00304. git merge --squash feat00304 stages all the changes from the feature branch into the working tree as a single uncommitted set of changes. The developer then makes one explicit commit, resulting in a clean, single-commit integration into the primary branch - preserving the work…
Question
A developer is working on a feature for a new application. The changes in the existing branch named 'feat00304' must be integrated into a single commit with the current working primary branch named 'prodapp411926287'. Which git command must be used?
Options
- Agit rebase --merge feat00304
- Bgit merge --squash feat00304
- Cgit push --rebase feat00304
- Dgit checkout --squash feat00304
How the community answered
(35 responses)- A3% (1)
- B89% (31)
- C3% (1)
- D6% (2)
Explanation
git merge --squash feat00304 stages all the changes from the feature branch into the working tree as a single uncommitted set of changes. The developer then makes one explicit commit, resulting in a clean, single-commit integration into the primary branch - preserving the work without the full commit history of the feature branch. git rebase --merge is not a valid flag combination for this purpose. git push --rebase is not a valid command. git checkout --squash does not exist.
Topics
Community Discussion
No community discussion yet for this question.