Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new branch named 'feature'.
Git
git branch [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'main' or 'master' creates or switches to existing branches, not new feature branches.
✗ Incorrect
The command git branch feature creates a new branch called 'feature'.
2fill in blank
mediumComplete the command to switch to the 'feature' branch.
Git
git [1] feature Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' only lists or creates branches, it does not switch.
✗ Incorrect
The command git checkout feature switches your working directory to the 'feature' branch.
3fill in blank
hardFix the error in the command to merge 'feature' into 'main'.
Git
git [1] feature Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'checkout' or 'branch' instead of 'merge' causes errors or wrong actions.
✗ Incorrect
The correct command to combine changes from 'feature' into 'main' is git merge feature while on 'main' branch.
4fill in blank
hardFill both blanks to create and switch to a new branch named 'bugfix'.
Git
git [1] -b [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' with '-b' is invalid; '-b' is used with 'checkout'.
✗ Incorrect
The command git checkout -b bugfix creates and switches to the 'bugfix' branch in one step.
5fill in blank
hardFill all three blanks to delete a local branch named 'oldfeature'.
Git
git [1] -[2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'checkout' instead of 'branch' will cause errors.
✗ Incorrect
The command git branch -d oldfeature deletes the local branch named 'oldfeature'.