Challenge - 5 Problems
Repository Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of listing all configured remote repositories?
You run the command
git remote -v in a repository with two remotes named origin and upstream. What is the expected output?Linux CLI
git remote -v
Attempts:
2 left
💡 Hint
The
-v option shows URLs for fetch and push separately.✗ Incorrect
The
git remote -v command lists all remotes with their URLs and whether they are used for fetching or pushing.💻 Command Output
intermediate2:00remaining
What is the output of adding a new remote repository?
You run
git remote add backup https://example.com/backup.git in your repository. Then you run git remote. What is the output?Linux CLI
git remote
Attempts:
2 left
💡 Hint
The
git remote command lists remote names only.✗ Incorrect
After adding a remote named
backup, git remote lists all remote names, including origin and backup.🔧 Debug
advanced2:00remaining
Why does this command fail to clone a repository?
You run
git clone git@github.com:user/repo.git but get an error: Permission denied (publickey). What is the most likely cause?Linux CLI
git clone git@github.com:user/repo.git
Attempts:
2 left
💡 Hint
The error mentions
Permission denied (publickey) which relates to SSH authentication.✗ Incorrect
This error means SSH authentication failed because the SSH key is missing or not loaded. Setting up SSH keys and adding them to the agent fixes this.
💻 Command Output
advanced2:00remaining
What is the output of listing all branches including remote ones?
You run
git branch -a in a repository with local branches main, dev and remote branches origin/main, origin/feature. What is the output?Linux CLI
git branch -a
Attempts:
2 left
💡 Hint
The
-a option shows local and remote branches with the remotes/ prefix.✗ Incorrect
The output lists local branches with an asterisk marking the current branch, and remote branches prefixed with
remotes/.🧠 Conceptual
expert2:00remaining
What happens when you run
git fetch --prune?You run
git fetch --prune in a repository. What is the effect of the --prune option?Attempts:
2 left
💡 Hint
Pruning cleans up references to remote branches that were deleted.
✗ Incorrect
The
--prune option removes remote-tracking branches that no longer exist on the remote repository, keeping your local references clean.