SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Git Advanced Interview Questions
Git Intermediate Interview Questions
www.edureka.co
Git Beginners Interview Questions
Git Beginners Interview Questions
www.edureka.co
www.edureka.co
What is Git?01
Beginners Interview Questions
www.edureka.co
What is a distributed VCS?02
Beginners Interview Questions
www.edureka.co
What are the advantages of using a VCS?03
Beginners Interview Questions
• Provides flexibility
• All the versions easily available
• Changes can be tracked easily
• Provides backup
www.edureka.co
Difference between Git and SVN
Beginners Interview Questions
Git SVN
1. Git is a Decentralized Version
Control tool
1. SVN is a Centralized Version
Control tool
2. It belongs to the 3rd generation
of Version Control tools
2. It belongs to the 2nd generation
of Version Control tools
3. Clients can clone entire
repositories on their local systems
3. Version history is stored on a
server-side repository
4. Commits are possible even if
offline
4. Only online commits are
allowed
5. Push/pull operations are faster 5. Push/pull operations are slower
6. Works are shared automatically
by commit
6. Nothing is shared automatically
04
www.edureka.co
Difference between Git and Github.
Beginners Interview Questions
05
GitHub is an American company that provides hosting for software
development version control using Git. It offers all of the distributed version
control and source code management(SCM) functionality of Git as well as
adding its own features.
www.edureka.co
What language is used in Git?
Beginners Interview Questions
06
Git uses ‘C’ language. GIT is fast, and ‘C’ language makes this
possible by reducing the overhead of run times associated with
high-level languages.
www.edureka.co
• Github
• Gitlab
• Bitbucket
• SourceForge
• GitEnterprise
Mention various Git repository hosting functions
Beginners Interview Questions
07
www.edureka.co
What is a repository in Git?
Beginners Interview Questions
08
www.edureka.co
01 What is a bare repository in Git?
Beginners Interview Questions
09
www.edureka.co
What is a commit message?
Beginners Interview Questions
10
Command that is used to write a commit message is “git commit -a”.
www.edureka.co
How do you fix a broken commit?
Beginners Interview Questions
11
www.edureka.co
Explain some basic Git commands.
Beginners Interview Questions
12
• git rm [file]
• git log
• git show [commit]
• git tag [commitID]
• git checkout [branch name]
• git checkout –b [branch name]
www.edureka.co
What is a conflict in Git?
Beginners Interview Questions
13
Git can handle on its own most merges by using its automatic merging features.
www.edureka.co
How do you resolve a conflict in Git?
Beginners Interview Questions
14
www.edureka.co
How do you revert a commit that has already been pushed
and made public?
Beginners Interview Questions
15
There can be two approaches to tackle this question and make sure that you include
both because any of the below options can be used depending on the situation
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co
What is SubGit?
Beginners Interview Questions
16
SubGit is a tool for SVN to Git migration. It can create a writable git mirror of a local
or remote Subversion repository and use both Subversion and Git as long as you like.
www.edureka.co
What is the difference between Git pull and fetch?
Beginners Interview Questions
17
www.edureka.co
What is staging area or index?
Beginners Interview Questions
18
www.edureka.co
What is the use of git instaweb?
Beginners Interview Questions
‘git instaweb’ is used to automatically direct a web browser and run a
webserver with an interface into your local repository.
19
www.edureka.co
‘git is-tree’ represents a tree object including the mode and the
name of each item and the SHA-1 value of the tree.
What is git is-tree?20
Intermediate Interview Questions
GIT INTERMEDIATE INTERVIEW QUESTIONS
www.edureka.co
www.edureka.co
What is Git stash?21
Intermediate Interview Questions
Stashing takes your working directory that is, your modified tracked files
and staged changes and saves it on a stack of unfinished changes that you
can reapply at any time.
www.edureka.co
If you want to continue working where you had left your work then 'git stash
apply' command is used to bring back the saved changes onto your current
working directory.
What is the function of git stash apply?22
Intermediate Interview Questions
www.edureka.co
What work is restored when the deleted branch is recovered?23
Intermediate Interview Questions
The files which were stashed and saved in the stash index list will be recovered
back. Any untracked files will be lost.
www.edureka.co
'git diff ’ depicts the changes between commits, commit and working tree etc. whereas
‘git status’ shows you the difference between the working directory and the index, it is
helpful in understanding git more comprehensively.
Explain the difference between git status and git diff24
Intermediate Interview Questions
www.edureka.co
git remote add creates an entry in your git config that specifies a name for a
particular URL whereas ‘git clone’ creates a new git repository by copying an
existing one located at the URL
Mention differences between git clone and git remote25
Intermediate Interview Questions
www.edureka.co
Git ‘stash drop’ command is used to remove the stashed item. It will remove the last
added stash item by default, and it can also remove a specific item if you include it as
an argument.
What is git stash drop?26
Intermediate Interview Questions
www.edureka.co
How to find a list of files that changed during a commit?27
Intermediate Interview Questions
To get a list files that has changed in a particular commit use the
below command:
git diff-tree -r {hash}
git diff-tree --no-commit-id --name-only -r {hash}
www.edureka.co
Git uses your username to associate commits with an identity. The git
config command can be used to change your Git configuration,
including your username.
git config --global user.name “your name”
git config --global user.email “Your email”
What is the function of git config?28
Intermediate Interview Questions
www.edureka.co
What does commit object contain?29
Intermediate Interview Questions
Commit object contains the following components, you should mention all the
three points present below:
• A set of files
• Reference to parent commit objects
• An SHA-1 name
www.edureka.co
Describe the branching strategies that you have used.30
Intermediate Interview Questions
• Feature
• Task
• Release
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co
Explain the advantages of forking workflow.31
Intermediate Interview Questions
There is a fundamental difference between the forking workflow and other popular git
workflows. Rather than using a single server-side to act as the "central" codebase, it
gives every developer their own server-side repository. The Forking Workflow is
commonly seen in public open-source projects.
www.edureka.co
How to check whether a branch has already been merged
into the master?
32
Intermediate Interview Questions
git branch --merged
git branch --no-merged
www.edureka.co
Why is it desirable to create an additional commit rather than
amending an existing commit?
33
Intermediate Interview Questions
1. The amend operation destroys the state that was previously saved in a
commit.
2. Growth of a small commit and acquire unrelated changes.
www.edureka.co
What does hook comprise of in Git?34
Intermediate Interview Questions
This directory consists of shell scripts that are activated if you run the
corresponding Git commands.
www.edureka.co
How do you return a commit that has just been pushed and
made open?
Intermediate Interview Questions
35
• One or more commits can be reverted through the use of git revert
• git revert HEAD~2..HEAD
• Alternatively, there is always an option to check out the state of a
particular commit from the past and commit it anew.
www.edureka.co
How to remove a file from Git without removing it from your
file system?
36
Intermediate Interview Questions
git reset filename # or
echo filename >> .gitignore
www.edureka.co
Could you explain git workflow?
Intermediate Interview Questions
To record the history of the project, Gitflow workflow employs two parallel
long-running branches - master and develop
37
www.edureka.co
Explain the difference between head, working tree and index
Intermediate Interview Questions
38
www.edureka.co
Intermediate Interview Questions
Explain the difference between fork, branch and clone.39
www.edureka.co
Intermediate Interview Questions
What are the different ways by which you can refer to a
commit?
git commit
40
www.edureka.co
What is the difference between rebasing and merge?
Intermediate Interview Questions
41
www.edureka.co
Mention the difference between revert and reset.
Intermediate Interview Questions
42
GIT ADVANCED INTERVIEW QUESTIONS
www.edureka.co
www.edureka.co
git reset –soft HEAD~N &&
git commit
git reset –soft HEAD~N &&
git commit –edit -m”$(git log –format=%B –reverse .HEAD@{N})”
How to squash last N commits into a single commit?
Advanced Interview Questions
43
www.edureka.co
What is git bisect? How do you use it to determine the
source of a bug?
Advanced Interview Questions
44
git bisect <subcommand> <options>
www.edureka.co
Advanced Interview Questions
How to integrate git with jenkins?45
• Click on Manage Jenkins on the Jenkins
dashboard.
• Click on Manage Plugins.
• In the plugins page, click on Git and select
install without restart.
• After this got to Manage Jenkins on
Jenkins dashboard. There you will see this
plugin installed.
www.edureka.co
Advanced Interview Questions
How to integrate git with jenkins?45
www.edureka.co
Advanced Interview Questions
How to integrate git with jenkins?45
www.edureka.co
Advanced Interview Questions
How to integrate git with jenkins?45
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co
Advanced Interview Questions
How to integrate git with jenkins?45
www.edureka.co
Advanced Interview Questions
How do you configure a repository to run code sanity
checking tools right before making commits?
46
Sanity or smoke test determines whether it is possible and reasonable to continue
testing.
www.edureka.co
Advanced Interview Questions
How do you configure a repository to run code sanity
checking tools right before making commits?
46
#!/bin/sh
files=$(git diff –cached –name-only –diff-filter=ACM | grep ‘.go$’)
if [ -z files ]; then
exit 0
fi
unfmtd=$(gofmt -l $files)
if [ -z unfmtd ]; then
exit 0
fi
echo “Some .go files are not fmt’d”
exit 1
www.edureka.co
What is git cherry-pick?
Advanced Interview Questions
47
• Used to introduce a particular commit from one branch within a repository
onto a different branch .
• Used to forward- or back-port commits from a maintenance branch to a
development branch
www.edureka.co
What is Git reflog?
Advanced Interview Questions
48
Keeps a track of every single change made in the reference of a repository.
Command: git reflog
www.edureka.co
How to recover a deleted branch using git reflog?
Advanced Interview Questions
49
• History log of all references
• Identify history stamp
• Recover
www.edureka.co
How to recover a deleted branch using git reflog?
Advanced Interview Questions
49
www.edureka.co
Mention some of the git reflog sub commands
Advanced Interview Questions
50
• $git reflog --help
• git reflog show
• git reflog expire
• git reflog delete
• git reflog exists
www.edureka.co

Weitere ähnliche Inhalte

Was ist angesagt?

Microservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaMicroservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker, Inc.
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
 
Learning Docker from Square One
Learning Docker from Square OneLearning Docker from Square One
Learning Docker from Square OneDocker, Inc.
 
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Simplilearn
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices Bozhidar Bozhanov
 

Was ist angesagt? (20)

Microservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaMicroservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | Edureka
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
DevOps and Tools
DevOps and ToolsDevOps and Tools
DevOps and Tools
 
DevOps for beginners
DevOps for beginnersDevOps for beginners
DevOps for beginners
 
CI CD Basics
CI CD BasicsCI CD Basics
CI CD Basics
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
DevOps introduction
DevOps introductionDevOps introduction
DevOps introduction
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Learning Docker from Square One
Learning Docker from Square OneLearning Docker from Square One
Learning Docker from Square One
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
From Zero to Docker
From Zero to DockerFrom Zero to Docker
From Zero to Docker
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 

Ähnlich wie Git interview questions | Edureka

Version control git day02
Version control   git day02Version control   git day02
Version control git day02Gourav Varma
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing selfChen-Tien Tsai
 
Version control git day03(amarnath dada)
Version control   git day03(amarnath dada)Version control   git day03(amarnath dada)
Version control git day03(amarnath dada)Gourav Varma
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptxEshaan35
 
01 git interview questions &amp; answers
01   git interview questions &amp; answers01   git interview questions &amp; answers
01 git interview questions &amp; answersDeepQuest Software
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03Gourav Varma
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenchesNuno Caneco
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfuzair
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdfRobinRohit2
 
Getting Started with Git and GitHub
Getting Started with Git and GitHubGetting Started with Git and GitHub
Getting Started with Git and GitHubRabiraj Khadka
 
A crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubA crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubJerome Mberia
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03Gourav Varma
 

Ähnlich wie Git interview questions | Edureka (20)

Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Version control git day03(amarnath dada)
Version control   git day03(amarnath dada)Version control   git day03(amarnath dada)
Version control git day03(amarnath dada)
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
01 git interview questions &amp; answers
01   git interview questions &amp; answers01   git interview questions &amp; answers
01 git interview questions &amp; answers
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
 
Getting Started with Git and GitHub
Getting Started with Git and GitHubGetting Started with Git and GitHub
Getting Started with Git and GitHub
 
Gitting better
Gitting betterGitting better
Gitting better
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
A crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubA crash course on git as version control system and GitHub
A crash course on git as version control system and GitHub
 
3 Git
3 Git3 Git
3 Git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 

Mehr von Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaEdureka!
 

Mehr von Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Git interview questions | Edureka

  • 1.
  • 2. Git Advanced Interview Questions Git Intermediate Interview Questions www.edureka.co Git Beginners Interview Questions
  • 3. Git Beginners Interview Questions www.edureka.co
  • 5. www.edureka.co What is a distributed VCS?02 Beginners Interview Questions
  • 6. www.edureka.co What are the advantages of using a VCS?03 Beginners Interview Questions • Provides flexibility • All the versions easily available • Changes can be tracked easily • Provides backup
  • 7. www.edureka.co Difference between Git and SVN Beginners Interview Questions Git SVN 1. Git is a Decentralized Version Control tool 1. SVN is a Centralized Version Control tool 2. It belongs to the 3rd generation of Version Control tools 2. It belongs to the 2nd generation of Version Control tools 3. Clients can clone entire repositories on their local systems 3. Version history is stored on a server-side repository 4. Commits are possible even if offline 4. Only online commits are allowed 5. Push/pull operations are faster 5. Push/pull operations are slower 6. Works are shared automatically by commit 6. Nothing is shared automatically 04
  • 8. www.edureka.co Difference between Git and Github. Beginners Interview Questions 05 GitHub is an American company that provides hosting for software development version control using Git. It offers all of the distributed version control and source code management(SCM) functionality of Git as well as adding its own features.
  • 9. www.edureka.co What language is used in Git? Beginners Interview Questions 06 Git uses ‘C’ language. GIT is fast, and ‘C’ language makes this possible by reducing the overhead of run times associated with high-level languages.
  • 10. www.edureka.co • Github • Gitlab • Bitbucket • SourceForge • GitEnterprise Mention various Git repository hosting functions Beginners Interview Questions 07
  • 11. www.edureka.co What is a repository in Git? Beginners Interview Questions 08
  • 12. www.edureka.co 01 What is a bare repository in Git? Beginners Interview Questions 09
  • 13. www.edureka.co What is a commit message? Beginners Interview Questions 10 Command that is used to write a commit message is “git commit -a”.
  • 14. www.edureka.co How do you fix a broken commit? Beginners Interview Questions 11
  • 15. www.edureka.co Explain some basic Git commands. Beginners Interview Questions 12 • git rm [file] • git log • git show [commit] • git tag [commitID] • git checkout [branch name] • git checkout –b [branch name]
  • 16. www.edureka.co What is a conflict in Git? Beginners Interview Questions 13 Git can handle on its own most merges by using its automatic merging features.
  • 17. www.edureka.co How do you resolve a conflict in Git? Beginners Interview Questions 14
  • 18. www.edureka.co How do you revert a commit that has already been pushed and made public? Beginners Interview Questions 15 There can be two approaches to tackle this question and make sure that you include both because any of the below options can be used depending on the situation
  • 19. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 20. www.edureka.co What is SubGit? Beginners Interview Questions 16 SubGit is a tool for SVN to Git migration. It can create a writable git mirror of a local or remote Subversion repository and use both Subversion and Git as long as you like.
  • 21. www.edureka.co What is the difference between Git pull and fetch? Beginners Interview Questions 17
  • 22. www.edureka.co What is staging area or index? Beginners Interview Questions 18
  • 23. www.edureka.co What is the use of git instaweb? Beginners Interview Questions ‘git instaweb’ is used to automatically direct a web browser and run a webserver with an interface into your local repository. 19
  • 24. www.edureka.co ‘git is-tree’ represents a tree object including the mode and the name of each item and the SHA-1 value of the tree. What is git is-tree?20 Intermediate Interview Questions
  • 25. GIT INTERMEDIATE INTERVIEW QUESTIONS www.edureka.co
  • 26. www.edureka.co What is Git stash?21 Intermediate Interview Questions Stashing takes your working directory that is, your modified tracked files and staged changes and saves it on a stack of unfinished changes that you can reapply at any time.
  • 27. www.edureka.co If you want to continue working where you had left your work then 'git stash apply' command is used to bring back the saved changes onto your current working directory. What is the function of git stash apply?22 Intermediate Interview Questions
  • 28. www.edureka.co What work is restored when the deleted branch is recovered?23 Intermediate Interview Questions The files which were stashed and saved in the stash index list will be recovered back. Any untracked files will be lost.
  • 29. www.edureka.co 'git diff ’ depicts the changes between commits, commit and working tree etc. whereas ‘git status’ shows you the difference between the working directory and the index, it is helpful in understanding git more comprehensively. Explain the difference between git status and git diff24 Intermediate Interview Questions
  • 30. www.edureka.co git remote add creates an entry in your git config that specifies a name for a particular URL whereas ‘git clone’ creates a new git repository by copying an existing one located at the URL Mention differences between git clone and git remote25 Intermediate Interview Questions
  • 31. www.edureka.co Git ‘stash drop’ command is used to remove the stashed item. It will remove the last added stash item by default, and it can also remove a specific item if you include it as an argument. What is git stash drop?26 Intermediate Interview Questions
  • 32. www.edureka.co How to find a list of files that changed during a commit?27 Intermediate Interview Questions To get a list files that has changed in a particular commit use the below command: git diff-tree -r {hash} git diff-tree --no-commit-id --name-only -r {hash}
  • 33. www.edureka.co Git uses your username to associate commits with an identity. The git config command can be used to change your Git configuration, including your username. git config --global user.name “your name” git config --global user.email “Your email” What is the function of git config?28 Intermediate Interview Questions
  • 34. www.edureka.co What does commit object contain?29 Intermediate Interview Questions Commit object contains the following components, you should mention all the three points present below: • A set of files • Reference to parent commit objects • An SHA-1 name
  • 35. www.edureka.co Describe the branching strategies that you have used.30 Intermediate Interview Questions • Feature • Task • Release
  • 36. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 37. www.edureka.co Explain the advantages of forking workflow.31 Intermediate Interview Questions There is a fundamental difference between the forking workflow and other popular git workflows. Rather than using a single server-side to act as the "central" codebase, it gives every developer their own server-side repository. The Forking Workflow is commonly seen in public open-source projects.
  • 38. www.edureka.co How to check whether a branch has already been merged into the master? 32 Intermediate Interview Questions git branch --merged git branch --no-merged
  • 39. www.edureka.co Why is it desirable to create an additional commit rather than amending an existing commit? 33 Intermediate Interview Questions 1. The amend operation destroys the state that was previously saved in a commit. 2. Growth of a small commit and acquire unrelated changes.
  • 40. www.edureka.co What does hook comprise of in Git?34 Intermediate Interview Questions This directory consists of shell scripts that are activated if you run the corresponding Git commands.
  • 41. www.edureka.co How do you return a commit that has just been pushed and made open? Intermediate Interview Questions 35 • One or more commits can be reverted through the use of git revert • git revert HEAD~2..HEAD • Alternatively, there is always an option to check out the state of a particular commit from the past and commit it anew.
  • 42. www.edureka.co How to remove a file from Git without removing it from your file system? 36 Intermediate Interview Questions git reset filename # or echo filename >> .gitignore
  • 43. www.edureka.co Could you explain git workflow? Intermediate Interview Questions To record the history of the project, Gitflow workflow employs two parallel long-running branches - master and develop 37
  • 44. www.edureka.co Explain the difference between head, working tree and index Intermediate Interview Questions 38
  • 45. www.edureka.co Intermediate Interview Questions Explain the difference between fork, branch and clone.39
  • 46. www.edureka.co Intermediate Interview Questions What are the different ways by which you can refer to a commit? git commit 40
  • 47. www.edureka.co What is the difference between rebasing and merge? Intermediate Interview Questions 41
  • 48. www.edureka.co Mention the difference between revert and reset. Intermediate Interview Questions 42
  • 49. GIT ADVANCED INTERVIEW QUESTIONS www.edureka.co
  • 50. www.edureka.co git reset –soft HEAD~N && git commit git reset –soft HEAD~N && git commit –edit -m”$(git log –format=%B –reverse .HEAD@{N})” How to squash last N commits into a single commit? Advanced Interview Questions 43
  • 51. www.edureka.co What is git bisect? How do you use it to determine the source of a bug? Advanced Interview Questions 44 git bisect <subcommand> <options>
  • 52. www.edureka.co Advanced Interview Questions How to integrate git with jenkins?45 • Click on Manage Jenkins on the Jenkins dashboard. • Click on Manage Plugins. • In the plugins page, click on Git and select install without restart. • After this got to Manage Jenkins on Jenkins dashboard. There you will see this plugin installed.
  • 53. www.edureka.co Advanced Interview Questions How to integrate git with jenkins?45
  • 54. www.edureka.co Advanced Interview Questions How to integrate git with jenkins?45
  • 55. www.edureka.co Advanced Interview Questions How to integrate git with jenkins?45
  • 56. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 57. www.edureka.co Advanced Interview Questions How to integrate git with jenkins?45
  • 58. www.edureka.co Advanced Interview Questions How do you configure a repository to run code sanity checking tools right before making commits? 46 Sanity or smoke test determines whether it is possible and reasonable to continue testing.
  • 59. www.edureka.co Advanced Interview Questions How do you configure a repository to run code sanity checking tools right before making commits? 46 #!/bin/sh files=$(git diff –cached –name-only –diff-filter=ACM | grep ‘.go$’) if [ -z files ]; then exit 0 fi unfmtd=$(gofmt -l $files) if [ -z unfmtd ]; then exit 0 fi echo “Some .go files are not fmt’d” exit 1
  • 60. www.edureka.co What is git cherry-pick? Advanced Interview Questions 47 • Used to introduce a particular commit from one branch within a repository onto a different branch . • Used to forward- or back-port commits from a maintenance branch to a development branch
  • 61. www.edureka.co What is Git reflog? Advanced Interview Questions 48 Keeps a track of every single change made in the reference of a repository. Command: git reflog
  • 62. www.edureka.co How to recover a deleted branch using git reflog? Advanced Interview Questions 49 • History log of all references • Identify history stamp • Recover
  • 63. www.edureka.co How to recover a deleted branch using git reflog? Advanced Interview Questions 49
  • 64. www.edureka.co Mention some of the git reflog sub commands Advanced Interview Questions 50 • $git reflog --help • git reflog show • git reflog expire • git reflog delete • git reflog exists