Question:- What is DevOps? Is it a tool?
Answer:- DevOps can’t be referred to as a tool; it is a collaborative work culture that combines development and operations teams for continuous development, continuous testing, continuous integration, continuous deployment, and continuous monitoring.
Question:- What are the core operations of DevOps in terms of development and infrastructure?
Answer:- The core operations of DevOps are application development, version control, unit testing, deployment with infrastructure, monitoring, configuration, and orchestration.
Question:- Our team has some ideas and wants to turn those ideas into a software application. Now, as a manager, I am confused about whether I should follow the Agile work culture or DevOps. Can you tell me why I should follow DevOps over Agile?
Answer:- According to the current market trend, instead of releasing big sets of features in an application, companies are launching small features for software with better product quality and quick feedback from customers, for high customer satisfaction. Now, to keep up with this, we have to: • Increase the deployment frequency in the safest and reliable way • Lower the failure rate of new releases • Shorten the bug resolution time DevOps fulfills all these requirements for fast and reliable development and deployment of software. Companies like Amazon and Google have adopted DevOps and are launching thousands of code deployments per day. But Agile, on the other hand, only focuses on the development of software.
Question:- Can one consider DevOps as an Agile methodology?
Answer:- DevOps can be considered as complementary to the Agile methodology but not completely similar.
Question:- Can you tell me the advantages of using Git?
Answer:- Data redundancy and replication High availability Only one Git directory per repository Superior disk utilization and network performance Collaboration friendly Can be used for any sort of projects
Question:- Are git fetch and git pull the same?
Answer:- The command ‘git pull’ pulls any new commits from a branch from the central repository and then updates the target branch in the local repository. But, ‘git fetch’ is a slightly different form of ‘git pull’. Unlike ‘git pull’, it pulls all new commits from the desired branch and then stores them in a new branch in the local repository. In order to reflect these changes in your target branch, ‘git fetch’ must be followed with a ‘git merge’. The target branch will only be updated after merging with the fetched branch (where we performed ‘git fetch’). We can also interpret the whole thing with an equation like this: git pull = git fetch + git merge
Question:- What are the benefits of using version control?
Answer:- • It helps improve the collaborative work culture: Here, team members are allowed to work freely on any file at any time. The version control system allows us to merge all changes into a common version. • It keeps different versions of code files securely: All the previous versions and variants of code files are neatly packed up inside the version control system. • It understands what happened: Every time we save a new version of our project, the version control system asks us to provide a short description of what was changed. More than that it allows us to see what changes were made in the file’s content, as well as who has made those changes. • It keeps backup: A distributed version control system like Git allows all team members to have the complete history of the project file so that in case there is a breakdown in the central server, they can use any of their teammate’s local Git repository.
Question:- How do you handle the merge conflicts in Git?
Answer:- In order to resolve the merge conflicts in Git, we need to follow three steps: • Understand what happened: It could be because of the same line edit on the same file; it could be because of deleting some files, or also it could be because of files with the same file names. You can check everything by using ‘git status’. • Mark and clean up the conflict: When we open the files using the merge tool, Git marks the conflicted area like this ‘<<<<< HEAD’ and ‘ >>>>> [other/branch/name]’. • Perform commit again and then merge the current branch with the master branch.
Question:- Can you tell me some advantages of Forking Workflow over other Git workflows?
Answer:- Forking Workflow is fundamentally different from other Git workflows. Instead of using a single server-side repository to act as the ‘central’ codebase, Forking Workflow gives every developer their own server-side repositories. This workflow is most often seen in public open-source projects. The main advantage is that contributions can be integrated without the need for everyone to push to a single central repository to maintain clean project history. Developers can push to their own server-side repositories, and only the project maintainer will push to the official repository. As soon as developers are ready to publish their local commits, they will push their commits to their own public repositories. Then, they will perform a pull request from the main repository, which notifies the project maintainer that an update is ready to be integrated.
Question:- When do you use ‘git rebase’ instead of ‘git merge’?
Answer:- Both ‘git rebase’ and ‘git merge’ commands are designed to integrate changes from one branch into another branch: just that they just do it in different ways. When we perform rebase of a feature branch onto the master branch, we move the base of the feature branch to the master branch’s ending point. By performing a merge, we take the contents of the feature branch and integrate them with the master branch. As a result, only the master branch is changed, but the feature branch history remains the same. Merging adds a new commit to your history. Rebasing will create inconsistent repositories. For individuals, rebasing makes a lot of sense. Now, in order to see the history completely, the same way as it has happened, we should use merge. Merge preserves history, whereas rebase rewrites it.
Question:- When do you use ‘git rebase’ instead of ‘git merge’?
Answer:- Both ‘git rebase’ and ‘git merge’ commands are designed to integrate changes from one branch into another branch: just that they just do it in different ways. When we perform rebase of a feature branch onto the master branch, we move the base of the feature branch to the master branch’s ending point. By performing a merge, we take the contents of the feature branch and integrate them with the master branch. As a result, only the master branch is changed, but the feature branch history remains the same. Merging adds a new commit to your history. Rebasing will create inconsistent repositories. For individuals, rebasing makes a lot of sense. Now, in order to see the history completely, the same way as it has happened, we should use merge. Merge preserves history, whereas rebase rewrites it.
Question:- I just made a bad git commit and made it public, and I need to revert the commit. Can you suggest me how to do that?
Answer:- Here we can use the Git command: git revert This command is very helpful because we can revert any commands just by adding the commit ID.
Question:- Can you tell me how to squash the last n commits into a single commit? Is it even possible?
Answer:- To squash the last n commits into a single commit, we can use: git reset -- soft HEAD~n && git commit
Question:- I want to move or copy Jenkins from one server to another. Is it possible? If yes, how?
Answer:- I would suggest copying the Jenkins jobs directory from the old server to the new one. We can just move a job from one installation of Jenkins to another by just copying the corresponding job directory. Or, we can also make a copy of an existing Jenkins job by making a clone of that job directory in a different name. Another way is that we can rename an existing job by renaming the directory. But, if you change the name of a job, you will need to change any other job that tries to call the renamed job.