0
0
Gitdevops~10 mins

Why staging before committing matters in Git - Test Your Understanding

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 [1] README.md
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' to stage files
2fill in blank
medium

Complete the code to commit staged changes with a message.

Git
git commit -m [1]
Drag options to blanks, or click blank then click option'
AREADME.md
B"Initial commit"
C-a
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename instead of a message
Omitting quotes around the message
3fill in blank
hard

Fix the error in the command to add all changed files to staging.

Git
git [1] .
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 commits to remote
4fill in blank
hard

Fill both blanks to show the status of files and then stage a specific file.

Git
git [1]
git [2] index.html
Drag options to blanks, or click blank then click option'
Astatus
Badd
Ccommit
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'add' to stage
Using 'push' instead of 'status' to check changes
5fill in blank
hard

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

Git
git [1] app.py
git commit -m [2]
git [3] origin main
Drag options to blanks, or click blank then click option'
Aadd
B"Update app logic"
Cpush
Dclone
Attempts:
3 left
💡 Hint
Common Mistakes
Skipping staging before commit
Using 'clone' instead of 'push' to send changes