0
0
Gitdevops~10 mins

Why merging combines work in Git - Test Your Understanding

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

Complete the command to merge the branch named 'feature' into the current branch.

Git
git [1] feature
Drag options to blanks, or click blank then click option'
Acheckout
Bcommit
Cbranch
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'checkout' instead of 'merge' to combine branches.
Trying to use 'commit' to merge branches.
2fill in blank
medium

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

Git
git [1] -b feature
Drag options to blanks, or click blank then click option'
Acheckout
Bmerge
Ccommit
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'merge' to create a new branch.
Using 'push' instead of 'checkout' to switch branches.
3fill in blank
hard

Fix the error in the command to merge the 'feature' branch into the current branch.

Git
git [1] feature
Drag options to blanks, or click blank then click option'
Acommit
Bmerge
Cpush
Dbranch
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'merge' to combine branches.
Using 'push' which uploads changes but does not merge.
4fill in blank
hard

Fill both blanks to create a new branch named 'feature' and then merge it into 'main'.

Git
git [1] -b feature
git checkout [2] 
git merge feature
Drag options to blanks, or click blank then click option'
Acheckout
Bmain
Cfeature
Dbranch
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to merge without switching back to 'main' branch.
Using 'branch' instead of 'checkout' to create branches.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps branch names to their latest commit hashes, filtering only branches starting with 'feature'.

Git
branch_commits = [1]: [2] for [3] in branches if [3].startswith('feature')
Drag options to blanks, or click blank then click option'
Abranch
Bbranches
Dget_commit_hash(branch)
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong variable name in the loop.
Not filtering branches starting with 'feature'.