Data Science Questions and Answers – CLI and Git Workflow – 2

This set of Data Science Interview Questions and Answers focuses on “CLI and Git Workflow – 2”

1. Which of the following adds all new files to local repository?
a) git add .
b) git add -u
c) git add -A
d) none of the mentioned
View Answer

Answer: a
Explanation: You should do this before committing.

2. Point out the correct statement.
a) You don’t need GitHub to use Git
b) CLI can help you to organize files and folders
c) Navigation of directory is possible using CLI
d) None of the mentioned
View Answer

Answer: b
Explanation: CLI stands for Command Line Interface.

3. Which of the following command updates tracking for files that are modified?
a) git add .
b) git add -u
c) git add -A
d) none of the mentioned
View Answer

Answer: b
Explanation: The git add command adds a change in the working directory to the staging area.

4. Which of the following command is used to give a message description?
a) git command -m
b) git command -d
c) git command -message
d) none of the mentioned
View Answer

Answer: a
Explanation: This only updates your local repository.

advertisement
advertisement

5. Point out the wrong statement.
a) You need GitHub to use Git
b) GitHub allows you to share repositories with others
c) GitHub allows you to access others repositories
d) All of the mentioned
View Answer

Answer: a
Explanation: GitHub can store a remote copy of your repository.

6. Which of the following command allows you to update the repository?
a) push
b) pop
c) update
d) none of the mentioned
View Answer

Answer: a
Explanation: The git branch command is your general-purpose branch administration tool.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. Which of the following is the correct way of creating GitHub repository in to well labelled commits?
a) Fork another user’s repository
b) Pop another user’s repository
c) Zip another user’s repository
d) None of the mentioned
View Answer

Answer: a
Explanation: A fork is a copy of a repository.

8. Which of the following command is used to squash the commits?
a) rebase
b) squash
c) boot
d) all of the mentioned
View Answer

Answer: a
Explanation: In Git, there are two main ways to integrate changes from one branch into another: the merge and the rebase.

advertisement

9. Which of the following statement would create branch named as ‘sanfoundry’?
a) git checkout -b sanfoundry
b) git checkout -c sanfoundry
c) git check -b sanfoundry
d) none of the mentioned
View Answer

Answer: a
Explanation: A branch in Git is simply a lightweight movable pointer to one of these commits.

10. branch command is used to determine which branch you are currently in.
a) True
b) False
View Answer

Answer: a
Explanation: -r flag should be used for copying the content.

advertisement

Sanfoundry Global Education & Learning Series – Data Science.

Here’s the list of Best Books in Data Science.

To practice all areas of Data Science for Interviews, Here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.