0
0
Gitdevops~10 mins

Clean vs dirty working directory in Git - Interactive Practice

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

Complete the command to check the status of your working directory.

Git
git [1]
Drag options to blanks, or click blank then click option'
Astatus
Bpush
Cclone
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' instead of 'git status' to check changes.
Trying 'git push' which sends commits to remote but doesn't show local changes.
2fill in blank
medium

Complete the command to discard changes in a single file and restore it to the last committed state.

Git
git checkout -- [1]
Drag options to blanks, or click blank then click option'
Abranch
Bfilename
Cremote
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' or 'commit' instead of the actual file name.
Omitting the file name, which causes an error.
3fill in blank
hard

Fix the error in the command to stage all changed files for commit.

Git
git [1] .
Drag options to blanks, or click blank then click option'
Aadd
Bcommit
Cpush
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit .' which tries to commit without staging.
Using 'git push .' which sends commits to remote but doesn't stage files.
4fill in blank
hard

Fill the blank to create a command that shows only the names of files that have changed but are not staged.

Git
git diff [1]
Drag options to blanks, or click blank then click option'
A--all
B--cached
C--staged
D--name-only
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--cached' or '--staged' which shows staged changes instead.
Using '--all' which is not a valid option here.
5fill in blank
hard

Fill all three blanks to create a command that resets the index and working directory to the last commit, discarding all changes.

Git
git reset --[1] && git checkout [2] -- [3]
Drag options to blanks, or click blank then click option'
Ahard
BHEAD
C.
Dsoft
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'soft' reset which does not discard working directory changes.
Forgetting to specify 'HEAD' or the path '.' in checkout.