0
0
Gitdevops~10 mins

Tracking branches concept 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 list all local branches with their tracking information.

Git
git branch [1]
Drag options to blanks, or click blank then click option'
A-vv
B-a
C-r
D--delete
Attempts:
3 left
💡 Hint
Common Mistakes
Using -a shows all branches including remote, not tracking info.
Using -r shows only remote branches.
Using --delete deletes a branch, not lists branches.
2fill in blank
medium

Complete the command to create a new local branch feature that tracks the remote branch origin/feature.

Git
git checkout -b feature [1]
Drag options to blanks, or click blank then click option'
A--detach origin/feature
B--no-track origin/feature
C--orphan origin/feature
D--track origin/feature
Attempts:
3 left
💡 Hint
Common Mistakes
Using --no-track disables tracking, opposite of what is needed.
Using --orphan creates a branch with no history.
Using --detach creates a detached HEAD state.
3fill in blank
hard

Fix the error in the command to set the upstream branch for the current branch to origin/main.

Git
git branch [1] origin/main
Drag options to blanks, or click blank then click option'
A--set-upstream
B--track
C--set-upstream-to
D--unset-upstream
Attempts:
3 left
💡 Hint
Common Mistakes
Using --set-upstream is deprecated and causes error.
Using --track is for creating branches, not setting upstream.
Using --unset-upstream removes tracking, not sets it.
4fill in blank
hard

Fill both blanks to create a new branch dev that tracks origin/dev and switch to it.

Git
git [1] -b dev [2] origin/dev
Drag options to blanks, or click blank then click option'
Acheckout
Bbranch
C--track
D--no-track
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' command does not switch branches automatically.
Using --no-track disables tracking, which is not desired here.
5fill in blank
hard

Fill all three blanks to show the current branch, its upstream branch, and the remote URL.

Git
git [1] && git [2] -vv && git remote [3] origin
Drag options to blanks, or click blank then click option'
Abranch --show-current
Bbranch
Cget-url
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git remote show origin' shows more info but not just the URL.
Using 'git branch' alone does not show current branch only.
Using wrong options causes errors or incomplete info.