Basic Git Interview Questions
Basic Git Interview Questions
Git is an open-distributed version control system that allows developers to track changes to their
codebase and collaborate on projects with other developers. Git is typically used for software
development, but it can be used for any type of file.
When a developer makes a change to a code file, they can commit that change to their local Git
repository. Then, they can push their changes to a remote Git repository, such as a server hosted by
a company or an open-source project. Other developers can then pull the changes down from the
remote repository and incorporate them into their code.
And an important thing about Git is that it is a free source and open to anyone.
Git is a version control system for tracking changes in computer files and is used to help coordinate
work among several people on a project while tracking progress over time. In other words, it’s a tool
that facilitates source code management in software development.
Git favors both programmers and non-technical users by keeping track of their project files. It
enables multiple users to work together and handles large projects efficiently.
A version control system (VCS) records all the changes made to a file or set of data, so a specific
version may be called later if needed.
This helps ensure that all team members are working on the latest version of the file
3. What is GitHub?
To provide Internet hosting for version control and software development, GitHub makes use of Git.
GitHub
SourceForge
GitLab
Bitbucket
Local version control systems have a database that stores all file changes under revision control on
disc in a special format.
Centralized version control systems have a single repository, from which each user receives their
working copy.
Distributed version control systems contain multiple repositories, and different users can access
each one with their working copy.
Git GitHub
Git can be installed locally on the system GitHub is hosted on the web
Git repository refers to a place where all the Git files are stored. These files can either be stored on
the local repository or on the remote repository.
If you want to initialize an empty repository to a directory in Git, you need to enter the git init
command. After this command, a hidden .git folder will appear.
GIT SVN
Git stores content in the form of metadata. SVN stored data in the form of files.
The contents of Git are hashed using the SHA-1 hash algorithm. SVN doesn’t support hashed contents.
11. Name a few Git commands with their function.
Git commit - Commit changes to head but not to the remote repository
Widespread acceptance
Pull requests
Git is a fast and reliable version control system, and the language that makes this possible is ‘C.’
Using C language reduces the overhead of run times, which are common in high-level languages.
git init - This command helps to create an empty repository while working on a project.
The git pull origin master fetches all the changes from the master branch onto the origin and
integrates them into the local branch.
After having gone through the beginner level Git interview questions, let us now look at
intermediate GIT interview questions and answers.
Intermediate Git Interview Questions
The Git push command is used to push the content in a local repository to a remote repository. After
a local repository has been modified, a push is executed to share the modifications with remote
team members.
19. GitHub, GitLab and Bitbucket are examples of git repository _______ function?
hosting. All the three are services for hosting Git repositories
A Git merge conflict is an event that occurs when Git is unable to resolve the differences in code
between the two commits automatically.
Git is capable of automatically merging the changes only if the commits are on different lines or
branches.