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.
To bring a new feature from any branch to the main branch, you can use the command "git merge" or "git pull command" to get new features from the same branch.
Conflicts come into picture when a user has some changes in local and he tries to pull the latest code from remote, if the remote varies in content of the same file then conflict arises, and other thing when user has some changes in local branch and he tries to merge another branch which has different content in it.
To resolve the conflicts in git, edit the conflicting files, discuss with your team and keep whatever required and remove what is not needed. Then git add, git commit and push. Git knows that you are in the middle of a merger, so it sets the parents of the commit correctly.
Once you merge your development branch into the main branch, you don’t need a development branch. To delete a branch use the command to delete local branch "git branch -d < localBranchName >" to delete remote branch "git push origin --delete < remoteBranchName >".
"Rebasing" is an alternative to merging in git.
Syntax used to rebase the branch is 'git rebase
‘git remote add origin URL’ just adds remote repository's origin to your git config that specifies a name for a particular URL. While, ‘git clone URL’ copies the entire git repository located at the URL to the local.
Version control allows you to track the commit history of files and to revert the changes. Each version captures a snapshot of the file system at a certain point of time. And it has all the files and their histories in a repository.
Here are Some best GIT client for LINUX:
a) Git Cola
c) Smart git
e) Git GUI
Subgit is a tool to migrate from SVN to Git. Some of its features are:
a) It supports all git and all sub-version features
b) There is no requirement to change the company’s infrastructure
c) It is much better than git-svn
d) Provides genuine & smooth migration experience.