0
0
Gitdevops~10 mins

Untracked vs tracked files 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 see untracked files in your Git repository.

Git
git status [1]
Drag options to blanks, or click blank then click option'
A--untracked-files=no
B--untracked-files=all
C--tracked-files=all
D--show-untracked
Attempts:
3 left
💡 Hint
Common Mistakes
Using --untracked-files=no hides untracked files.
Using --tracked-files=all is not a valid option.
Using --show-untracked is not a git status option.
2fill in blank
medium

Complete the command to add a new file to the tracked files in Git.

Git
git [1] newfile.txt
Drag options to blanks, or click blank then click option'
Acommit
Bpush
Cadd
Dtrack
Attempts:
3 left
💡 Hint
Common Mistakes
Using git commit before adding files.
Using git push to add files.
Using git track which is not a git command.
3fill in blank
hard

Fix the error in the command to remove a file from tracking but keep it locally.

Git
git [1] --cached file.txt
Drag options to blanks, or click blank then click option'
Arm
Breset
Cuntrack
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using git reset which resets commits, not files.
Using git remove which is not a git command.
Using git untrack which does not exist.
4fill in blank
hard

Fill both blanks to create a command that shows tracked files and ignores untracked files.

Git
git status [1]=[2]
Drag options to blanks, or click blank then click option'
A--untracked-files
Bno
Call
Dtracked
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' to show untracked files instead of hiding them.
Using 'tracked' which is not a valid option.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps tracked files to their sizes if size is greater than 1000 bytes.

Git
file_sizes = [1]: os.path.getsize([2]) for [3] in tracked_files if os.path.getsize([3]) > 1000
Drag options to blanks, or click blank then click option'
Af
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names causing errors.
Using undefined variables.