Git
Git
1. What is Git?
o Git is a distributed version control system that tracks changes in source code during
software development, enabling multiple developers to work on a project
simultaneously.
o Use git status to view the state of the working directory and staging area.
o Use git add <file> to stage specific files or git add . to stage all changes.
o Use git commit -m "commit message" to commit staged changes with a message.
o Use git merge <branch_name> to merge the specified branch into the current
branch.
o A Git conflict occurs when two branches have conflicting changes. Resolve conflicts
by editing the affected files and then staging and committing the changes.
o Use git push origin <branch_name> to push commits from a local branch to a remote
repository.
14. What is Git rebase, and when should you use it?
o Git rebase is a way to move or combine a series of commits to a new base commit.
It’s used to clean up the commit history or to apply changes from one branch onto
another.
o A .gitignore file specifies which files or directories Git should ignore and not track.
o Git bisect is a tool used to find the commit that introduced a bug by performing a
binary search through the commit history.
1. What is GitHub?
o GitHub is a web-based platform for version control and collaboration that uses Git. It
allows developers to host repositories, manage projects, and collaborate with
others.
o Go to GitHub, click on "New Repository," provide a name and description, and then
create the repository.
o A fork is a personal copy of someone else’s repository. It allows you to make changes
without affecting the original project.
o After pushing changes to your forked repository, go to the original repository and
click "New Pull Request" to submit your changes for review.
o GitHub Actions is a CI/CD tool integrated into GitHub that automates workflows like
building, testing, and deploying code.
o Navigate to the pull request on GitHub, and click "Revert" to undo the changes
introduced by the pull request.
o A GitHub issue is a tool for tracking tasks, enhancements, and bugs in a repository.
o GitHub Pages is a service that allows you to host static websites directly from a
GitHub repository.
o A GitHub gist is a simple way to share code snippets, notes, or any text across the
web.
o Go to the repository settings, scroll down to "GitHub Pages," and choose the source
branch and directory.
o Go to the repository settings, scroll down, and select "Archive this repository."
o GitHub Sponsors is a program that allows you to fund open-source projects and
developers directly on GitHub.
o Go to GitHub settings, navigate to "Security," and follow the steps to enable 2FA.
o GitHub and GitLab are both Git repository hosting services, but GitLab offers more
built-in CI/CD features, while GitHub integrates with third-party tools for CI/CD.
o Go to GitHub, click on your profile, select "Your organizations," and click "New
organization" to create one.
Jenkins
1. What is Jenkins?
o Jenkins can be installed using package managers like apt, yum, or brew, or by
downloading the .war file and running it with Java.
o Create a Jenkinsfile in the root directory of your project and define the pipeline
stages and steps in it.
o A Jenkins job is a task or set of tasks configured to run on the Jenkins server.
o Jenkins Blue Ocean is a modern interface for Jenkins pipelines that provides a better
user experience.
o Use the Git plugin to configure Jenkins to pull code from a Git repository.
o Jenkins agents (or nodes) are machines that Jenkins can use to execute jobs.
o Jenkins plugins extend the functionality of Jenkins, such as integrating with version
control systems, CI/CD tools, and cloud providers.
o Manage plugins via the Jenkins dashboard under "Manage Jenkins" > "Manage
Plugins."
o In this architecture, the Jenkins master manages the jobs, while slaves are machines
that perform the job execution.
o Configure a new node in "Manage Jenkins" > "Manage Nodes" and connect it to the
master.
17. What is a Jenkins build?
o Jenkins logs can be monitored via the Jenkins dashboard under "Manage Jenkins" >
"System Log" or by accessing the Jenkins log files directly.
o Use the archiveArtifacts step in your Jenkins pipeline to specify which files or
directories should be archived.
o The post block in a Jenkins pipeline is used to define actions that should be
performed after the pipeline's main stages, such as cleanup, notifications, or
archiving results.
Grafana
1. What is Grafana?
o Grafana is an open-source platform for monitoring and observability that allows you
to visualize and analyze data from various sources through customizable dashboards.
o Add a data source by navigating to the Grafana settings, selecting the data source
type, and configuring the connection details.
o Create a custom dashboard by selecting the panels you need, configuring queries,
and arranging them according to your monitoring needs.
o Alerting in Grafana allows you to set up rules that trigger notifications when certain
conditions are met, helping you respond to issues proactively.
o Configure alerts by defining alert rules in your panels, setting thresholds, and
specifying notification channels like email or Slack.
8. What are Grafana panels?
o Manage users and permissions by creating user accounts, assigning roles (Admin,
Editor, Viewer), and configuring access controls for dashboards and data sources.
o Loki is a log aggregation system designed to work with Grafana, enabling you to
visualize and search logs alongside metrics.
o Set up Grafana with Docker by pulling the Grafana image from Docker Hub and
running it with docker run, optionally linking it with data sources like Prometheus.
o Grafana plugins are extensions that add new data sources, panels, and apps,
allowing you to extend Grafana's capabilities.
o Export dashboards by saving them as JSON files, and import them by uploading the
JSON file or using the dashboard import feature in Grafana.
o Manage performance by optimizing queries, using efficient data sources, and scaling
the Grafana deployment to handle large amounts of data and users.