AlgoMaster Logo

Remote Repositories - Quiz

Last Updated: January 3, 2026

Remote Repositories Exercises

30 quizzes

1
Code Completion

List all configured connections to remote repositories for the current project

shell
1
git remote -

Click an option to fill the blank:

2
Code Completion

Download new commits from the default remote without changing your current branch

shell
1
git

Click an option to fill the blank:

3
Code Completion

Send your local commits on the current branch to its configured upstream branch

shell
1
git

Click an option to fill the blank:

4
Code Completion

Set the upstream branch when pushing a new local branch to the origin remote for the first time

shell
1
git push my-feature

Click an option to fill the blank:

5
Code Completion

Add a new connection to a teammate’s repository so you can fetch their changes

shell
1
git remote teammate https://example.com/teammate/repo.git

Click an option to fill the blank:

6
Multiple Choice

In a typical collaborative setup, what does the remote repository mainly provide compared to your local repository?

7
Multiple Choice

What does git remote add actually configure?

8
Multiple Choice

Which statement best describes git fetch?

9
Multiple Choice

After setting an upstream branch, what does a plain git pull (without arguments) do?

10
Multiple Choice

What is origin/main typically referring to?

11
Sequencing

Order the steps to add a new remote and fetch its branches so you can inspect them locally

Drag and drop to reorder, or use the arrows.

12
Sequencing

Order the steps to safely update your local main with the latest changes from origin before starting new work

Drag and drop to reorder, or use the arrows.

13
Sequencing

Order the steps to create a local branch from a remote branch and publish your commits back to that remote branch

Drag and drop to reorder, or use the arrows.

14
Sequencing

Order the steps to set an upstream branch for an existing local branch and then synchronize it

Drag and drop to reorder, or use the arrows.

15
Output Prediction

You are currently on the branch feature/login. What will this command print?

1git branch --show-current
16
Output Prediction

You just ran git remote add origin https://example.com/repo.git. What will this command output?

1git remote
17
Output Prediction

Your current branch main is tracking origin/main and is 2 commits ahead of origin/main with no uncommitted changes. What will this command print?

1git status -sb
18
Output Prediction

You are on main and origin/main is one commit ahead of your local main. What will this command print immediately after git fetch origin?

1git rev-parse --abbrev-ref --symbolic-full-name @{u}
19
Bug Spotting

Identify the incorrect command in this workflow for updating a fork's main branch from the original repository

Click on the line(s) that contain the bug.

shell
1
git checkout main
2
git fetch upstream
3
git merge upstream/master
4
git push origin main
20
Bug Spotting

Find the mistake in this sequence intended to publish a new branch and set its upstream

Click on the line(s) that contain the bug.

shell
1
git checkout -b feature-report
2
git commit -am 'Add report feature'
3
git push origin -u feature-report
21
Bug Spotting

Spot the incorrect command in this attempt to rename a remote and update its URL

Click on the line(s) that contain the bug.

shell
1
git remote rename origin old-origin
2
git remote add origin
3
git remote set-url origin git@github.com:user/repo.git
4
git fetch origin
22
Matching

Match each Git command with its primary purpose when working with remotes

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

23
Matching

Match the upstream tracking-related concept to its description

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

24
Matching

Match the remote branch terms with their meanings

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

25
Fill in the Blanks

Complete the commands to clone a repository and set main to track origin/main explicitly

shell
1
git https://example.com/project.git
2
cd project
3
git branch --set-upstream-to=

Click an option to fill blank 1:

26
Fill in the Blanks

Complete the commands to fetch from origin and preview differences between your local main and origin/main

shell
1
git origin
2
git main

Click an option to fill blank 1:

27
Fill in the Blanks

Complete the commands to create a local tracking branch from a remote branch and push new commits

shell
1
git checkout -b
2
# make changes and commit
3
git

Click an option to fill blank 1:

28
Hotspot Selection

Select the line that shows the remote-tracking branch for main on origin

Click on the line to select.

shell
1
  main
2
* feature/login
3
  remotes/origin/main
4
  remotes/origin/feature/login
29
Hotspot Selection

Select the part of git status output that indicates the upstream branch for your current branch

Click on the line to select.

shell
1
On branch feature/search
2
Your branch is up to date with 'origin/feature/search'.
3
 
4
nothing to commit, working tree clean
30
Hotspot Selection

Select the line that shows the fetch URL for the origin remote

Click on the line to select.

shell
1
origin	git@github.com:user/repo.git (fetch)
2
origin	git@github.com:user/repo.git (push)