0
0
Gitdevops~10 mins

Trunk-based development in Git - 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 the main branch in Git.

Git
git checkout [1]
Drag options to blanks, or click blank then click option'
Afeature
Brelease
Cmain
Ddevelop
Attempts:
3 left
💡 Hint
Common Mistakes
Using a feature branch name instead of the main branch.
Typing 'master' when the main branch is named 'main'.
2fill in blank
medium

Complete the command to create a new short-lived feature branch from main.

Git
git checkout -b [1] main
Drag options to blanks, or click blank then click option'
Afeature-login
Bhotfix
Crelease-v1
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'main' as the new branch name, which already exists.
Using long-lived branch names like 'release-v1' in trunk-based development.
3fill in blank
hard

Fix the error in the command to merge the feature branch back into main.

Git
git checkout main
 git [1] feature-login
Drag options to blanks, or click blank then click option'
Apush
Bbranch
Ccommit
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' instead of 'git merge'.
Trying to push before merging.
4fill in blank
hard

Fill both blanks to push the main branch and delete the feature branch locally.

Git
git [1] origin main
 git branch [2] feature-login
Drag options to blanks, or click blank then click option'
Apush
Bpull
Cdelete
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git pull' instead of 'git push' to send changes.
Using 'git branch delete' which is invalid syntax.
5fill in blank
hard

Fill all three blanks to fetch updates, rebase your feature branch on main, and then push it.

Git
git [1]
git checkout feature-login
git [2] main
git [3] origin feature-login
Drag options to blanks, or click blank then click option'
Afetch
Brebase
Cpush
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git merge' instead of 'git rebase' in trunk-based development.
Pushing before rebasing, which can cause conflicts.