Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to list all tags in the repository.
Git
git [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git branch' lists branches, not tags.
Using 'git commit' shows commits, not tags.
✗ Incorrect
The git tag command lists all tags in the repository.
2fill in blank
mediumComplete the command to create a new tag named 'v1.0'.
Git
git [1] v1.0
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git push' sends data to remote but does not create tags.
Using 'git checkout' switches branches, not tags.
✗ Incorrect
The git tag v1.0 command creates a new tag named 'v1.0'.
3fill in blank
hardFix the error in the command to push tags to the remote repository.
Git
git push origin [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' or 'HEAD' pushes branches, not tags.
Using 'commit' is invalid in this context.
✗ Incorrect
The --tags option pushes all tags to the remote repository.
4fill in blank
hardFill in the blank to complete the GitHub Actions trigger for tags starting with 'v'.
Git
on:
push:
tags:
- '[1]*' Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'release-' or 'tag-' prefixes do not match version tags starting with 'v'.
✗ Incorrect
The trigger pattern 'v*' matches tags starting with 'v', commonly used for version tags.
5fill in blank
hardFill both blanks to complete the GitHub Actions job that runs only on tag pushes starting with 'v'.
Git
jobs:
deploy:
if: startsWith(github.ref, 'refs/tags/[1][2]')
runs-on: ubuntu-latest
steps:
- name: Deploy
run: echo "Deploying version tag" Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'release' instead of 'v-' causes the condition to fail.
✗ Incorrect
The condition checks if the tag starts with 'v-' followed by any characters, matching version tags like 'v-1.0'.