0
0
Gitdevops~10 mins

How Git stores objects - Interactive Practice

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

Complete the command to initialize a new Git repository.

Git
git [1]
Drag options to blanks, or click blank then click option'
Acommit
Binit
Cclone
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' before initializing a repository
Trying to 'git push' without a remote repository
Confusing 'git clone' with repository creation
2fill in blank
medium

Complete the command to add a file to the Git staging area.

Git
git [1] filename.txt
Drag options to blanks, or click blank then click option'
Acommit
Bpush
Cstatus
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' without staging files
Trying 'git push' before committing
Confusing 'git status' with adding files
3fill in blank
hard

Fix the error in the command to create a commit with a message.

Git
git commit -m [1]
Drag options to blanks, or click blank then click option'
AInitial_commit
BInitial commit
C"Initial commit"
D'Initial commit
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the commit message
Using mismatched or incomplete quotes
Using underscores instead of spaces without quotes
4fill in blank
hard

Fill both blanks to create a Git object hash from a file.

Git
git hash-object -[1] [2]
Drag options to blanks, or click blank then click option'
Aw
Br
Cfile.txt
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using -r which only reads the hash without storing
Using 'commit' instead of a filename
Omitting the filename
5fill in blank
hard

Fill all three blanks to create a tree object from a directory.

Git
git mktree < [1] | git hash-object -[2] --stdin -t [3]
Drag options to blanks, or click blank then click option'
Atree.txt
Bw
Ctree
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'tree' for object type
Omitting the write option -w
Not providing the correct input file