Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command 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 'checkout' instead of the branch name.
Trying to commit or merge instead of creating a branch.
✗ Incorrect
The git branch command followed by the branch name creates a new branch.
2fill in blank
mediumComplete the command to list all branches in the repository.
Git
git branch [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-d which deletes a branch.Using
-m which renames a branch.✗ Incorrect
The -a option lists all branches, including remote ones.
3fill in blank
hardFix the error in the command to create a branch named 'dev'.
Git
git [1] dev Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
checkout to create a branch without -b.Using
commit or merge which are unrelated.✗ Incorrect
To create a branch, use git branch <branch-name>. checkout switches branches but does not create one.
4fill in blank
hardFill both blanks to create a new branch 'test' and switch to it immediately.
Git
git [1] -[2] test
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
branch with -c which is invalid.Forgetting the dash before the option letter.
✗ Incorrect
The command git checkout -b test creates and switches to the 'test' branch.
5fill in blank
hardFill all three blanks to delete a local branch named 'old-feature' safely.
Git
git [1] -[2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase
-D which forces deletion.Trying to delete with
git checkout.✗ Incorrect
Use git branch -d old-feature to delete a branch safely (only if merged).