Complete the code to show the Git command that triggers a CI/CD pipeline on a new commit.
git [1]The git push command sends your committed changes to a remote repository, which often triggers the CI/CD pipeline to start automated testing and deployment.
Complete the sentence to explain why Git is used with CI/CD: "Git helps by {{BLANK_1}} code changes so CI/CD can test and deploy them."
"Git helps by [1] code changes so CI/CD can test and deploy them."
Git tracks code changes, which allows CI/CD systems to detect updates and run automated tests and deployments.
Fix the error in the Git command that triggers CI/CD after code changes: "git {{BLANK_1}} origin main"
git [1] origin mainThe correct command to send your local changes to the remote repository and trigger CI/CD is git push origin main.
Fill both blanks to complete the Git hook script that triggers CI/CD on push: "#!/bin/sh\n{{BLANK_1}} -u origin main\n{{BLANK_2}}"
#!/bin/sh [1] -u origin main [2]
The script pushes changes to the remote with git push -u origin main and then exits successfully with exit 0, which is standard for Git hooks.
Fill all three blanks to create a GitHub Actions workflow step that runs CI/CD on push: "on: push\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v2\n - name: Run tests\n run: {{BLANK_1}} {{BLANK_2}} {{BLANK_3}}"
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: [1] [2] [3]This step runs Python unit tests using python3 -m unittest, which is a common way to run tests in CI/CD pipelines.