Choose the best description of the main goal of trunk-based development in Git workflows.
Think about how trunk-based development helps reduce integration problems.
Trunk-based development encourages developers to work on a single shared branch (usually 'main' or 'trunk') to integrate changes frequently. This reduces merge conflicts and keeps the codebase stable.
Given the following commands executed in order, what will be the output of the final git log --oneline?
git checkout -b feature # make some commits # commit A # commit B git checkout main git merge feature --no-ff git log --oneline --first-parent -3
Consider what --first-parent does in git log.
The --first-parent option shows commits only from the main branch's history, including the merge commit. After merging feature into main with --no-ff, the merge commit appears on main.
Which option shows the correct sequence of steps for a developer using trunk-based development?
Think about how trunk-based development handles branches and integration speed.
Trunk-based development encourages short-lived branches that are merged back quickly to keep the trunk updated and reduce integration conflicts.
In trunk-based development, developers merge frequently to the trunk. What is a common cause of merge conflicts in this workflow?
Think about what happens when two people change the same part of a file.
Merge conflicts happen when multiple developers edit the same lines of code and try to merge their changes. Frequent merges help catch these conflicts early.
Choose the best practice that supports trunk-based development to keep the main branch stable and deployable.
Think about how automation helps maintain code quality in fast workflows.
Automated tests and quality checks on every commit ensure that the trunk remains stable and deployable, which is essential for trunk-based development and continuous delivery.