Git(Computer Science ) Questions and Answers

Question 1. Which is the following is the default text editor for the Bash shell with a Windows-based Git install?
  1.    Bash
  2.    Vim
  3.    Emacs
  4.    Notepad++
Explanation:-
Answer: Option B. -> Vim

Question 2. What is the default text editor for the Bash shell with a Windows-based Git install?
  1.    Emacs
  2.    Vim
  3.    Notepad++
  4.    Bash
Explanation:-
Answer: Option B. -> Vim

Question 3. What command removes untracked files from your working directory
  1.    git commit
  2.    git clean -f
  3.    git clean
  4.    git reset
Explanation:-
Answer: Option C. -> git clean

Question 4. Which programming language was used to create Git?
  1.    C
  2.    HTML
  3.    PHP
  4.    C++
Explanation:-
Answer: Option A. -> C

Question 5. What is the incorrect statement regarding information?
  1.    Processed information are taken to make decisions
  2.    Cost effectiveness is a feature of a quality information
  3.    Value of the information will be increased as time passes
  4.    All information is not suitable for decision making
Explanation:-
Answer: Option C. -> Value of the information will be increased as time passes

Question 6. Command use to connect remote repo with local repo
  1.    git remote add
  2.    git init
  3.    git connect repo
  4.    git configure
Explanation:-
Answer: Option A. -> git remote add

Question 7. Which one of them is incorrect command
  1.    git add Test.txt
  2.    git pull origin master
  3.    git push origin master
  4.    None
Explanation:-
Answer: Option D. -> None

Question 8. Which of the following is the correct way to initialize a new Git repository?
  1.    git add .
  2.    git init
  3.    git commit
  4.    none of the above
Explanation:-
Answer: Option B. -> git init

Question 9. How would you commit this with the message "adding new authors to index"?
  1.    git commit -m "adding new authors to index"
  2.    git commit "adding new authors to index"
  3.    git commit .
  4.    none of the above
Explanation:-
Answer: Option A. -> git commit -m "adding new authors to index"

Question 10. Which of the following commands will create a new branch?
  1.    git checkout new-branch
  2.    git checkout -b new-branch
  3.    git clone new-branch
  4.    git create-branch new-branch
Explanation:-
Answer: Option B. -> git checkout -b new-branch