Data Science & ML

Git Fundamentals

Commits, branches, merge, rebase, conflicts, pull requests, GitHub, collaborative workflows

18 interview questionsยท
Junior
1

What is Git?

Answer

Git is a distributed version control system created by Linus Torvalds in 2005. Unlike centralized systems like SVN, each developer has a complete copy of the project history locally. This allows working offline and offers great flexibility for collaborative workflows.

2

Which command initializes a new Git repository in a directory?

Answer

The git init command creates a new Git repository in the current directory. It generates a hidden .git folder containing all the structure needed for version tracking: commit history, branches, local configuration and Git objects.

3

What is the difference between git add and git commit?

Answer

Git uses an intermediate staging area (index) between modified files and history. git add moves changes to this staging area, preparing files for the next commit. git commit then records the staging area content into the permanent repository history.

4

What is a commit in Git?

5

Which command shows the current state of the Git repository?

+15 interview questions

Master Data Science & ML for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free