0
0
Gitdevops~10 mins

Switching branches with git switch - Interactive Code Practice

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

Complete the command to switch to an existing branch named 'feature'.

Git
git switch [1]
Drag options to blanks, or click blank then click option'
Afeature
Bcommit
Cmerge
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like 'commit' or 'merge' instead of the branch name.
Trying to switch without specifying a branch.
2fill in blank
medium

Complete the command to create and switch to a new branch named 'bugfix'.

Git
git switch -c [1]
Drag options to blanks, or click blank then click option'
Abugfix
Bmain
Corigin
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using existing branch names instead of the new branch name.
Omitting the branch name after -c.
3fill in blank
hard

Fix the error in the command to switch to branch 'release'.

Git
git [1] release
Drag options to blanks, or click blank then click option'
Acheckout
Bmerge
Ccommit
Dswitch
Attempts:
3 left
💡 Hint
Common Mistakes
Using commit or merge instead of switch.
Using checkout when the task asks for switch.
4fill in blank
hard

Fill both blanks to create and switch to a new branch named 'hotfix' starting from 'develop'.

Git
git switch -c [1] [2]
Drag options to blanks, or click blank then click option'
Ahotfix
Bmain
Cdevelop
Dfeature
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the branch names in the blanks.
Using unrelated branch names.
5fill in blank
hard

Fill all three blanks to switch to branch 'test', create it if missing, and force the switch discarding local changes.

Git
git switch [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-c
B-f
Ctest
D--discard-changes
Attempts:
3 left
💡 Hint
Common Mistakes
Using --discard-changes which is not a valid git switch option.
Omitting the branch name.