You are on page 1of 9

Git Assessment BC-101

Points: 15/20 Time: 08:29

Incorrect 0/1 Points

1. You want to create a new tag for a specific commit.


What Git command should you use?

`git tag -a tag-name`

`git create tag tag-name`

`git commit --tag tag-name`

`git tag tag-name`

Correct 1/1 Points

2. You want to see the changes between your working directory and the last commit.

Which Git command is suitable for this?

`git show`

`git status`

`git diff`
`git changes`

Correct 1/1 Points

3. To merge changes from one branch into another, which Git command should you
use?

`git commit`

`git merge`

`git branch`

`git pull`

Incorrect 0/1 Points

4. You accidentally committed a file and want to undo the last commit but keep the
changes in your working directory. Which Git command is appropriate?

`git revert`

`git reset`

`git commit --amend`

`git undo`

Correct 1/1 Points

5. Your team member has pushed changes to the remote repository, and you want to
update your local repository with these changes. What Git command should you
use?

`git fetch`
`git pull`

`git push`

`git update`

Correct 1/1 Points

6. You want to check the changes between two commits. Which Git command should
you use?

`git log commit-hash1..commit-hash2`

`git diff`

`git diff commit-hash1..commit-hash2`

`git status commit-hash1..commit-hash2`

Incorrect 0/1 Points

7. You want to discard changes in your working directory and go back to the last
committed state. Which Git command is suitable for this?

`git restore`

`git reset`

`git revert`

`git discard`

Correct 1/1 Points


8. After making changes to your branch, you want to push those changes to the
remote repository.

What Git command should you use?

`git upload`

`git commit -m "message"`

`git push origin branch-name`

`git merge origin/branch-name`

Incorrect 0/1 Points

9. You have done some changes, staged it and pushed the changes to remote
repository. after pushing you realized that you have made a mistake in one of the
commits that has been pushed.

How will you address this ?

git reset

git restore

git revert

git checkout

Correct 1/1 Points

10. You want to keep a copy of your codebase seperately with nobody able to update
it.

What GIT command should you use?


git tag

git clone

git commit

git branch

Correct 1/1 Points

11. You have multiple branches in your local repository, and you want to switch to a
different branch. Which Git command will help you achieve this?

`git merge`

`git branch -d`

`git clone`

`git switch`

Correct 1/1 Points

12. You want to delete a local branch. What GIT command should you use?

git remove

git branch -d

git delete-branch

git merge

Correct 1/1 Points


13. You need to create a copy of a remote repository on your local machine. Which Git
command should you use?

`git init`

`git copy`

`git pull`

`git clone`

Correct 1/1 Points

14. You've made changes to multiple files and staged some files. Few files are still
unstaged. Now, you want to discard all the unstaged changes. Staged changes
need to be retained.

What Git command should you use?

`git reset --hard`

`git revert HEAD`

`git discard`

`git restore`

Correct 1/1 Points

15. You want to create a new remote branch based on your local branch.

What GIT command should you use?

git branch -d

git push origin branch-name


git checkout -b new-branch

git create-remote-branch

Correct 1/1 Points

16. You want to see a list of all remote repositories associated with your local
repository. Which Git command is appropriate?

`git remote -v`

`git list remotes`

`git show remotes`

`git remote list`

Correct 1/1 Points

17. You've made several commits on your branch and want to see a concise history of
your commits. Which Git command is appropriate?

`git log`

`git history`

`git show`

`git status`

Correct 1/1 Points

18. You want to create a new branch named "feature-branch" to work on a new
feature. Which Git command should you use?
`git branch feature-branch`

`git clone -b feature-branch`

`git commit -m "feature-branch"`

`git merge feature-branch`

Incorrect 0/1 Points

19. You made a mistake in the previous commit message and need to update the
commit message.

What GIT command should you use?

git fix-commit

git commit --amend

git revert

git reset

Correct 1/1 Points

20. After making changes to files in your working directory, which Git command
should you use to stage these changes for commit?

`git add .`

`git commit -a`

`git stage .`

`git commit -m "message"`


Keep the information with you by saving your response.

Save my response

This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is not
responsible for the privacy or security practices of its customers, including those of this form owner. Never give out your
password.

Powered by Microsoft Forms | Privacy and cookies | Terms of use

You might also like