Jun

GIT MCQ
- Admin
- 20th Jun, 2022
- 711 Followers
Latest MCQ Tests
Pratice HR Questions
GIT MCQ Quiz
1) Which Command is used to show limited number of commits?
2) Which command defines the author email to be used for all commits by the current user:
3) ........ command is useful for getting a high-level overview of the project history:
4) Command to download all the objects and references from a specified repository:
6) Which of the following git command that downloads your repository from GitHub to your computer?
7) Which of the following shortcut to staging all the changes you have?
8) What is full form of VCS?
9) Git is a;
10) Which of the following is true about Centralized version control system?
11) The files that can be committed are always present in git:
12) Git can be used for which project?
13) Which of the following terminology is not related to git?
14) Which of the following is not true about git?
15) Which of the following git command can be used to check the stored stashes?
16) Which of the following option is not valid with git stash command?
17) Which of the following statement is true about git ignore file?
18) Which command helps us to see the tracked, untracked files and changes but does not show any commit records?
19) Git log command contains following data:
20) git log --oneline command will display:
21) The reference to the remote repository from where a project was initially cloned is called :
22) Tags in git can be:
23) Which is the correct git command to add files to the repository?
24) Which of the following is the correct git command to commit changes with proper message?
25) Which of the following git command helps to add multiple changes at the same time?
26) What does the below git command indicates? git add *.java
27) Which of the following is git tool?
28) ........ is a version of the repository that diverges from the main working project:
29) Which of the following are type of reset facility available in git?
30) Who created Git?
Git Online Test Questions (Git FAQs)
1) What is Subgit?
Subgit is stress free tool that helps in migration to GIT from SVN. It can be used with the server of Git be it the Gitlab, Github, or even the Bitbucket.
2) How to git remove file from commit?
In order to remove some files from a Git commit, use the "git reset" command with the "–soft" option and specify the commit before HEAD. To remove files from commits, use the "git restore" command, specify the source using the "–source" option and the file to be removed from the repository.
3) Which git command defines the author email to be used for all commits by the current user?
git config --global user.email command defines the author email to be used for all commits by the current user.
4) How to add Multi-line Git commit message from CLI?
To add Multi-line Git commit message from CLI
git commit -m 'message one' -m 'message 2' -m 'message n'
5) How to change the date of a commit in Git?
You can use GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"
to change the date of a commit in Git.
6) How to clone a specific branch in git?
For this, you must execute the "git branch" with the "-b" and mention the branch that you would want for cloning.
7) What git commit --allow-empty command do?
It make empty commits on throw away branches so that I can trigger various kinds of things for a variety of different reasons.
git commit --allow-empty -m "Trigger xyz"
8) How to completely overwrite local master with remote?
You can use git reset --hard origin/master
to completely overwrite local master with remote
9) What is best way to delete unused local branches in Git?
The Easy way to delete unused local branches in Git is
git checkout master git branch | xargs git branch -d
10) How to undo a git commit --amend?
What you need to do is to create a new commit with the same details as the current HEAD commit, but with the parent as the previous version of HEAD. git reset --soft will move the branch pointer so that the next commit happens on top of a different commit from where the current branch head is now.
Example
git reset --soft HEAD@{1} git commit -C HEAD@{1}
11) List some git basic commands?
git add, git status , git branch, git init, git commit, git config, git checkout, git merge are few basic git commands.
12) How to resolve git status "Unmerged paths:"?
Perform following steps to resolve git status "Unmerged paths:"
# if the file in the right place isn't already committed: git add # remove the "both deleted" file from the index: git rm --cached ../public/images/originals/dog.ai # commit the merge: git commit
13) How to display list of files containing conflicts in Git?
With git rebase you can always get the list files with conflicts that shall keep continuing.
14) What is the name of the branch where the deployment-ready code is kept?
It is the central branch which the developers in the team uses and always were in a deployment-ready state. In short the main brand for the project shall have the quality work and also the tested one.
15) Which git command is used to see a repository's history?
It is the Git's basic tool which is a git log command that can help to explore the repository's history. It is what you shall be using when you are looking for some version of the figure or the project that needs to be introduced by blending in the feature branch.
Leave A Comment :
Valid name is required.
Valid name is required.
Valid email id is required.