0
0
Gitdevops~20 mins

What is Git - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Git Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of Git?

Imagine you are working on a group project where everyone writes parts of a story. What does Git help you do?

ATrack changes in files and collaborate with others
BEdit images and videos
CSend emails to team members
DCreate presentations and slides
Attempts:
2 left
💡 Hint

Think about how you keep versions of your work and share with friends.

💻 Command Output
intermediate
2:00remaining
What does the command git status show?

You just changed some files in your project folder. You run git status. What information will you see?

Git
git status
AA list of all files in the folder
BList of changed files and their status (staged, unstaged, untracked)
CThe last commit message only
DThe current date and time
Attempts:
2 left
💡 Hint

Think about how you check what files have been changed before saving them.

🔀 Workflow
advanced
2:30remaining
What is the correct order of Git commands to save changes to a remote repository?

You made changes to your project and want to save them online so others can see. Which order of commands do you use?

A1,2,3
B2,1,3
C3,1,2
D1,3,2
Attempts:
2 left
💡 Hint

First prepare files, then save locally, then send online.

Troubleshoot
advanced
2:00remaining
What error occurs if you try to push without pulling first?

You run git push origin main but get an error. The remote has newer commits that you haven't pulled. What error message will Git show?

Aerror: failed to push because there are no commits to push
Berror: no changes added to commit
Cerror: failed to push some refs because the tip of your current branch is behind
Derror: remote repository not found
Attempts:
2 left
💡 Hint

Think about what happens if your local branch is not updated properly.

Best Practice
expert
3:00remaining
Which practice helps avoid conflicts when multiple people work on the same Git branch?

When many people edit the same files, conflicts can happen. What is the best way to reduce conflicts?

AAvoid using branches and commit directly to main
BWork offline for long periods before pushing
CDelete the remote branch and create a new one each time
DPull changes from remote often and commit small, frequent updates
Attempts:
2 left
💡 Hint

Think about how to keep your work updated with others' changes.