Courseiva
Software Development and DesignhardMultiple ChoiceObjective-mapped

200-901 Software Development and Design Practice Question

A developer is using Git for a project with a feature branch strategy. They have completed work on a new feature in the branch 'feature-logging' and want to integrate it into the main development branch 'develop'. The team requires that all commits on the feature branch be squashed into a single commit before merging. Which sequence of Git commands achieves this?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

git checkout develop && git merge feature-logging --squash && git commit

Squash merging combines all commits into one; using --squash option on merge accomplishes this.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • git checkout feature-logging && git rebase develop && git checkout develop && git merge feature-logging

    Why it's wrong here

    Rebase rewrites history but does not squash into one commit unless interactive rebase with squash is used.

  • git checkout develop && git merge feature-logging --squash && git commit

    Why this is correct

    Checks out develop, merges with squash, then commits the staged changes.

  • git checkout develop && git pull feature-logging && git commit --amend

    Why it's wrong here

    Incorrect commands; pull from a different branch is not standard.

  • git checkout develop && git merge --no-ff feature-logging

    Why it's wrong here

    --no-ff preserves all commits, does not squash.

About these practice questions

One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.