India: +91-944897 1000 , US: +1 408 809 3690 info@gamutgurus.com Register for upcoming demo
×

Top DevOps Interview Questions – Most Asked

Here we have compiled the most probable DevOps interview questions asked in the industry. You will learn about software version control, Git repository, reverting a commit in Git, Vagrant, continuous testing elements, and the importance of continuous integration, testing, and deployment. These questions are curated after discussing with many interviewers and DevOps Training experts.

Interview Questions
Git
Maven
Jenkins
Docker
Ansible
Interview Questions
Showing 31 - 40 of 251 results
31. What is the function of ‘git diff’ in git?

A $ git diff command lists you the changes between the commits.
For example: $ git diff < commitId1 > < commitId2 >

32. What is ‘git status’ used for?

Git Status’ shows your changes status in the working directory and the index area, it is helpful in understanding a git more comprehensively.

33. What is the difference between the ‘git diff ’and ‘git status’?

git diff’ is similar to ‘git status’, but "git diff" shows the differences between various commits, and "git status" shows the difference between local repo and the working directory and index.

34. What is the function of ‘git checkout’ in git?

A ‘git checkout’ updates your directories or specific files of your working tree. And to switch from one branch to another.
To switch among branches "git checkout "
To jump to specific commit "git checkout "

35. What is the function of ‘git rm’?

To remove the file/s from the staging area and also from the working directory ‘git rm’ is used.

36. What is the function of ‘git stash apply’?

It is possible to start your work form where you have left, ‘git stash apply’ command is used to bring back the saved changes to the working directory.

37. What is the use of ‘git log’?

GIt Log command shows you the commit history. To get specific histories of your project, there are some commands listed below:
$git log //shows complete history of your repository files.
$git log --oneline //shows all history but in one line.
$git log -n5 //shows last 5 commits history.
$git log --follow //shows complete history of that file even filename has been changed.
$git log --author //shows complete history committed by that user

38. What is ‘git add’ used for?

git add’ adds file/s from the working directory to your index area.

39. Is it to create an additional commit than to amend an existing commit?

Of Course creating a new commit is suggested then to edit the existing commit because, Amend operation will destroy the state of existing commit. If it is just a commit message changed then that is not a problem. But if the contents are changed then chances of eliminating something important remains more.

40. What is the function of ‘git reset’?

The command ‘git Reset’ is used to reset your index as well as the working directory to the state of your last commit. By doing this you left with zero changes in your working directory.

Contact Us