Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to create a new commit snapshot in Git.
Git
git commit -m [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'push' instead of a message
Omitting the message quotes
✗ Incorrect
The git commit -m command creates a new snapshot with a message describing the changes.
2fill in blank
mediumComplete the command to see the current snapshot history in Git.
Git
git [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' which stages files
Using 'branch' which manages branches
✗ Incorrect
The git log command shows the list of snapshots (commits) made so far.
3fill in blank
hardFix the error in the command to save all changes as a snapshot.
Git
git [1] -m "Save all changes"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'push' which sends commits to remote
Using 'status' which shows current state
✗ Incorrect
The git commit command saves the current staged changes as a snapshot with a message.
4fill in blank
hardFill both blanks to create a snapshot after adding files.
Git
git [1] . && git [2] -m "Snapshot after adding files"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'push' instead of 'commit'
Skipping 'add' before commit
✗ Incorrect
First, git add . stages all changes, then git commit -m creates the snapshot.
5fill in blank
hardFill all three blanks to create a snapshot and send it to the remote repository.
Git
git [1] . && git [2] -m "Update snapshot" && git [3] origin main
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fetch' instead of 'push'
Committing before adding files
✗ Incorrect
Stage changes with add, save snapshot with commit, then send it to remote with push.