Professional Documents
Culture Documents
2. You want to see the changes between your working directory and the last commit.
`git show`
`git status`
`git diff`
`git changes`
3. To merge changes from one branch into another, which Git command should you
use?
`git commit`
`git merge`
`git branch`
`git pull`
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 undo`
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`
6. You want to check the changes between two commits. Which Git command should
you use?
`git diff`
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`
`git upload`
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.
git reset
git restore
git revert
git checkout
10. You want to keep a copy of your codebase seperately with nobody able to update
it.
git clone
git commit
git branch
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 clone`
`git switch`
12. You want to delete a local branch. What GIT command should you use?
git remove
git branch -d
git delete-branch
git merge
`git init`
`git copy`
`git pull`
`git clone`
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.
`git discard`
`git restore`
15. You want to create a new remote branch based on your local branch.
git branch -d
git create-remote-branch
16. You want to see a list of all remote repositories associated with your local
repository. Which Git command is appropriate?
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`
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`
19. You made a mistake in the previous commit message and need to update the
commit message.
git fix-commit
git revert
git reset
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 stage .`
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.