0
0
Gitdevops~10 mins

Why Git integrates with CI/CD - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show the Git command that triggers a CI/CD pipeline on a new commit.

Git
git [1]
Drag options to blanks, or click blank then click option'
Acommit
Bclone
Cpush
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' only saves changes locally and does not trigger CI/CD.
Using 'git clone' downloads a repository but does not trigger CI/CD.
2fill in blank
medium

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
"Git helps by [1] code changes so CI/CD can test and deploy them."
Drag options to blanks, or click blank then click option'
Atracking
Bignoring
Chiding
Ddeleting
Attempts:
3 left
💡 Hint
Common Mistakes
Thinking Git hides or deletes changes, which is incorrect.
Ignoring changes would prevent CI/CD from working.
3fill in blank
hard

Fix the error in the Git command that triggers CI/CD after code changes: "git {{BLANK_1}} origin main"

Git
git [1] origin main
Drag options to blanks, or click blank then click option'
Apull
Bpush
Cfetch
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git pull' downloads changes but does not trigger CI/CD.
Using 'git fetch' only updates remote tracking branches.
4fill in blank
hard

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}}"

Git
#!/bin/sh
[1] -u origin main
[2]
Drag options to blanks, or click blank then click option'
Agit push
Bexit 0
Cgit commit
Decho 'CI/CD triggered'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' instead of 'git push' in the hook.
Not exiting the script properly can cause errors.
5fill in blank
hard

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}}"

Git
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run tests
        run: [1] [2] [3]
Drag options to blanks, or click blank then click option'
Apython3
B-m
Cunittest
Dnpm
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm' here would be wrong for Python tests.
Missing the '-m' flag causes the module not to run.