Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to delete a local Git branch named 'feature'.
Git
git branch [1] feature Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -D deletes forcefully, which is not always safe.
Using -r deletes remote branches, not local.
✗ Incorrect
The -d option safely deletes a local branch if it has been merged.
2fill in blank
mediumComplete the code to force delete a local Git branch named 'bugfix'.
Git
git branch [1] bugfix Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d will fail if the branch is not merged.
Using -r deletes remote branches, not local.
✗ Incorrect
The -D option force deletes a local branch even if it is not merged.
3fill in blank
hardFix the error in the command to delete a remote branch named 'release'.
Git
git push origin [1] release Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d or -D does not work with 'git push' for deleting remote branches.
Using 'delete' without dashes is invalid.
✗ Incorrect
The correct option to delete a remote branch is --delete.
4fill in blank
hardFill both blanks to delete a remote branch named 'hotfix' from origin.
Git
git push [1] [2] hotfix
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d instead of --delete for remote branch deletion.
Using wrong remote name like 'upstream' when origin is intended.
✗ Incorrect
Use origin as the remote name and --delete to remove the remote branch.
5fill in blank
hardFill all three blanks to delete a local branch 'test', then delete the remote branch 'test' from origin.
Git
git branch [1] test && git push [2] [3] test
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d instead of -D for local branch force delete.
Using -d instead of --delete for remote branch deletion.
✗ Incorrect
First, force delete the local branch with -D. Then push to origin with --delete to remove the remote branch.