Git Interview Questions and Answers TOP 30
These git interview questions and answers prepared by real time engineers who are working in real time projects.
and the explanations also taken care as real time situations.
What is the difference between git pull and git fetch
If you do git fetch it will download or pulls or fetch the new changes happened in remote and it will stores those changes in temporary location in local but it will not add those changes in local branches or files.
If you want to reflect those changes in your branch you need to run one more command that is git merge.
Git merge command will merge those new changes to local branch which came from remote.
And no need to run those commands you can use only one command for git fetch and git merge i.e git pull.
Git pull will do both git fetch followed by git merge.
Git pull= git fetch + git merge
Have you worked on feature branches
This explanation is for devops engineers.
Yes I worked on feature branches whenever I got a request to create like httpd ansible role or chef cookbook or puppet manifests I will create a feature branch. And I will work in that feature branch. After implementing or writing the role I will test that role on testing servers. after completion of the testing of that role I will create a pull request to some other main branch like master.
So the admin of the master branch will merge that feature branch into master branch.
- git interview questions and answers
- interview questions and answers for git