0
0
Gitdevops~10 mins

Staging area (index) purpose in Git - Interactive Code Practice

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

Complete the code to add a file to the staging area.

Git
git add [1]
Drag options to blanks, or click blank then click option'
Acommit
Bpush
Cfile.txt
Dclone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of a filename.
Trying to add a command like 'push' instead of a file.
2fill in blank
medium

Complete the command to see the current status of the staging area.

Git
git [1]
Drag options to blanks, or click blank then click option'
Acommit
Bstatus
Cpush
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'status'.
Using 'push' which sends changes to remote, not shows status.
3fill in blank
hard

Fix the error in the command to commit staged changes with a message.

Git
git commit -m [1]
Drag options to blanks, or click blank then click option'
A"Update files"
BUpdate files
CUpdate_files
D'Update files'
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes causes git to treat each word as separate arguments.
Using single quotes may work in some shells but double quotes are safer.
4fill in blank
hard

Fill both blanks to switch to the new-feature branch.

Git
git [1] [2]
Drag options to blanks, or click blank then click option'
Acheckout
Bbranch
Cnew-feature
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' instead of 'checkout' to switch branches.
Using 'commit' which is unrelated here.
5fill in blank
hard

Fill all three blanks to stage all changes, commit with a message, and push to remote.

Git
git [1] . && git commit -m [2] && git [3]
Drag options to blanks, or click blank then click option'
Aadd
B"Save all changes"
Cpush
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to stage files before committing.
Not quoting the commit message.
Using 'status' instead of 'push' to send changes.