0
0
Gitdevops~10 mins

HEAD pointer 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 show the current branch where HEAD is pointing.

Git
git [1]
Drag options to blanks, or click blank then click option'
Abranch
Bstatus
Ccommit
Dlog
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git status' which shows changes but not the branch list.
Using 'git commit' which creates a commit, not shows branches.
2fill in blank
medium

Complete the command to move HEAD to a specific commit hash.

Git
git checkout [1]
Drag options to blanks, or click blank then click option'
Abranch_name
Btag_name
Cremote_name
Dcommit_hash
Attempts:
3 left
💡 Hint
Common Mistakes
Using a branch name instead of a commit hash when wanting detached HEAD.
Using remote or tag names which are not commit hashes.
3fill in blank
hard

Fix the error in the command to reset HEAD to the previous commit.

Git
git reset [1] HEAD~1
Drag options to blanks, or click blank then click option'
A--merge
B--soft
C--hard
D--keep
Attempts:
3 left
💡 Hint
Common Mistakes
Using --hard which discards changes.
Using --merge or --keep which are for other reset behaviors.
4fill in blank
hard

Fill both blanks to create a new branch and move HEAD to it.

Git
git [1] -b [2]
Drag options to blanks, or click blank then click option'
Acheckout
Bbranch
Cnew-feature
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git branch -b' which is invalid syntax.
Using 'master' as the new branch name when the task expects 'new-feature'.
5fill in blank
hard

Fill all three blanks to show the commit where HEAD currently points.

Git
git [1] -[2] 1 [3]
Drag options to blanks, or click blank then click option'
Alog
Bn
CHEAD
Dbranch
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git branch' which lists branches, not commits.
Omitting the '-n' option to limit commits.