0
0
Gitdevops~10 mins

Deleting branches in Git - Interactive Code Practice

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

Complete 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'
A-d
B-D
C-r
D-m
Attempts:
3 left
💡 Hint
Common Mistakes
Using -D deletes forcefully, which is not always safe.
Using -r deletes remote branches, not local.
2fill in blank
medium

Complete 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'
A-d
B-D
C-r
D-m
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d will fail if the branch is not merged.
Using -r deletes remote branches, not local.
3fill in blank
hard

Fix 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'
Adelete
B-d
C--delete
D-D
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.
4fill in blank
hard

Fill 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'
Aorigin
B--delete
C-d
Dupstream
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.
5fill in blank
hard

Fill 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'
A-d
Borigin
C--delete
D-D
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.