0
0
Gitdevops~10 mins

How files move between three areas 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 add a file to the staging area.

Git
git [1] filename.txt
Drag options to blanks, or click blank then click option'
Aadd
Bcommit
Cpush
Dclone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'add'
Using 'push' which sends changes to remote
2fill in blank
medium

Complete the command to save staged changes to the local repository.

Git
git [1] -m "Save changes"
Drag options to blanks, or click blank then click option'
Apush
Bcommit
Cadd
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' instead of 'commit'
Using 'push' which sends changes to remote
3fill in blank
hard

Fix the error in the command to send commits to the remote repository.

Git
git [1] origin main
Drag options to blanks, or click blank then click option'
Apush
Bcommit
Cadd
Dpull
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'push'
Using 'pull' which downloads changes
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps files to their sizes only if size is greater than 1000.

Git
{filename: [1] for filename, size in files.items() if size [2] 1000}
Drag options to blanks, or click blank then click option'
Asize
B==
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '>'
Using '<' which selects smaller sizes
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase filenames to their sizes only if size is less than 5000.

Git
{filename[1]: size for filename, size in files.items() if size [2] 5000 and filename[3]('.txt')}
Drag options to blanks, or click blank then click option'
A.upper()
B<
C.endswith
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' for size
Using '.startswith' instead of '.endswith'