GH-900 practice question 14 of 15
In GitHub, why is it recommended to deploy from your feature branch before merging into the main branch?
Full set: 144 questionsDeploying from a feature branch to a staging or temporary production environment is a crucial step in modern CI/CD workflows, often referred to as creating a "preview environment." This practice allows developers, QA teams, and other stakeholders to verify and validate the proposed changes in a live, production-like setting. It ensures the new feature works as intended and does not introduce regressions or performance issues before the code is merged into the main branch. This pre-merge validation significantly reduces the risk of introducing bugs into the primary codebase, thereby maintaining the stability and integrity of the main branch.
A. This is incorrect because the purpose is to add an essential intermediate testing and verification step, not to eliminate it.
B. This is incorrect as this practice prioritizes quality and stability over the raw speed of merging by adding a validation step.
C. This is incorrect because this process is a form of controlled testing in a production or production-like environment, not a way to avoid it.
1. Official Vendor Documentation (GitHub): In the documentation for GitHub Actions
the concept of deploying to specific environments is detailed. It states
"Environments are used to describe a general deployment target like production
staging
or development... You can configure environments with protection rules and secrets. When a workflow job deploys to an environment
the job can't access secrets that are defined in other environments." This structure is designed to facilitate safe
pre-merge deployments from feature branches to non-production environments for verification.
Source: GitHub Docs
"Using environments for deployment
" Section: "About environments."
2. Official Vendor Documentation (GitHub): The GitHub Flow guide
a recommended workflow
implicitly supports this practice. The flow involves creating a branch
adding commits
opening a pull request
discussing and reviewing code
and then deploying for final verification before merging. This ensures that only production-ready code is merged into the main branch.
Source: GitHub Guides
"GitHub flow."
3. University Courseware (MIT): MIT's Software Construction course emphasizes the importance of automated testing and regression testing as part of the development cycle. Deploying a feature branch to a test environment is an advanced form of this principle
extending automated checks to a live system to validate functionality and integration before merging
which is a core tenet of robust software engineering.
Source: MIT OpenCourseWare
6.031: Software Construction
Spring 2016. Lecture 20: "Testing."
Keep practicing
Take the free GH-900 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GH-900 practice questions
- Question 1What is the difference between an organization member and an outside collaborator?
- Question 2New open source contributors can receive funding from GitHub sponsors:
- Question 3An employee needs to find all issues within organization “Avocado" containing text "404 e…
- Question 4How are commits related to pull requests?
- Question 5Where should a repository admin navigate to view pre-built visualizations from repository…
- Question 6Who can be assigned to an Issue or pull request? (Each answer presents a complete solutio…
