0% found this document useful (0 votes)
27 views8 pages

Git

Uploaded by

sankalp09ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views8 pages

Git

Uploaded by

sankalp09ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

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.

2. How do you create a new Git repository?

o Use the command git init to initialize a new Git repository.

3. How do you check the status of your Git repository?

o Use git status to view the state of the working directory and staging area.

4. How do you stage changes for a commit?

o Use git add <file> to stage specific files or git add . to stage all changes.

5. How do you commit changes?

o Use git commit -m "commit message" to commit staged changes with a message.

6. What is a branch in Git?

o A branch in Git is a pointer to a specific commit. Branches allow developers to work


on features, bug fixes, or experiments independently.

7. How do you create a new branch?

o Use git branch <branch_name> to create a new branch.

8. How do you switch between branches?

o Use git checkout <branch_name> to switch to another branch.

9. How do you merge branches?

o Use git merge <branch_name> to merge the specified branch into the current
branch.

10. What is a Git conflict, and how do you resolve it?

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.

11. How do you clone a repository?

o Use git clone <repository_url> to create a local copy of a remote repository.

12. How do you push changes to a remote repository?

o Use git push origin <branch_name> to push commits from a local branch to a remote
repository.

13. How do you pull changes from a remote repository?


o Use git pull to fetch and merge changes from a remote repository into the current
branch.

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.

15. How do you stash changes in Git?

o Use git stash to temporarily save changes without committing them.

16. How do you apply stashed changes?

o Use git stash apply to reapply stashed changes.

17. What is a .gitignore file?

o A .gitignore file specifies which files or directories Git should ignore and not track.

18. How do you view the commit history?

o Use git log to display a list of previous commits.

19. What is Git bisect?

o Git bisect is a tool used to find the commit that introduced a bug by performing a
binary search through the commit history.

20. What is a submodule in Git?

o A submodule allows you to keep a Git repository as a subdirectory of another Git


repository.
GitHub

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.

2. How do you create a new repository on GitHub?

o Go to GitHub, click on "New Repository," provide a name and description, and then
create the repository.

3. What is a GitHub fork?

o A fork is a personal copy of someone else’s repository. It allows you to make changes
without affecting the original project.

4. How do you create a pull request on GitHub?

o After pushing changes to your forked repository, go to the original repository and
click "New Pull Request" to submit your changes for review.

5. What is GitHub Actions?

o GitHub Actions is a CI/CD tool integrated into GitHub that automates workflows like
building, testing, and deploying code.

6. How do you revert a pull request?

o Navigate to the pull request on GitHub, and click "Revert" to undo the changes
introduced by the pull request.

7. What is a GitHub issue?

o A GitHub issue is a tool for tracking tasks, enhancements, and bugs in a repository.

8. How do you link a commit to an issue on GitHub?

o Use #issue_number in the commit message to link it to a specific GitHub issue.

9. What is GitHub Pages?

o GitHub Pages is a service that allows you to host static websites directly from a
GitHub repository.

10. How do you protect branches in GitHub?

o Go to the repository settings, navigate to "Branches," and enable branch protection


rules.

11. What is a GitHub webhook?

o A webhook is a way for one application to send real-time data to another


application. GitHub webhooks allow you to trigger actions in other services when
events occur in your repository.

12. How do you manage repository access on GitHub?


o Go to the repository settings, navigate to "Collaborators & Teams," and add users or
teams with specific permissions.

13. What is a GitHub gist?

o A GitHub gist is a simple way to share code snippets, notes, or any text across the
web.

14. How do you enable GitHub Pages on a repository?

o Go to the repository settings, scroll down to "GitHub Pages," and choose the source
branch and directory.

15. What is a GitHub organization?

o A GitHub organization is a shared account where groups of people can collaborate


across multiple projects.

16. How do you archive a repository on GitHub?

o Go to the repository settings, scroll down, and select "Archive this repository."

17. What is GitHub Sponsors?

o GitHub Sponsors is a program that allows you to fund open-source projects and
developers directly on GitHub.

18. How do you enable two-factor authentication (2FA) on GitHub?

o Go to GitHub settings, navigate to "Security," and follow the steps to enable 2FA.

19. What is the difference between GitHub and GitLab?

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.

20. How do you create a GitHub organization?

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 is an open-source automation server used for continuous integration and


continuous delivery (CI/CD).

2. How do you install 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.

3. What is a Jenkins pipeline?

o A Jenkins pipeline is a suite of plugins that supports implementing and integrating


continuous delivery pipelines.
4. What are the types of Jenkins pipelines?

o Declarative Pipeline and Scripted Pipeline.

5. How do you create a Jenkins pipeline?

o Create a Jenkinsfile in the root directory of your project and define the pipeline
stages and steps in it.

6. What is a Jenkins job?

o A Jenkins job is a task or set of tasks configured to run on the Jenkins server.

7. How do you trigger a Jenkins job?

o Jenkins jobs can be triggered manually, on a schedule (using CRON), or by events


such as code commits or pull requests.

8. What is Jenkins Blue Ocean?

o Jenkins Blue Ocean is a modern interface for Jenkins pipelines that provides a better
user experience.

9. How do you integrate Jenkins with Git?

o Use the Git plugin to configure Jenkins to pull code from a Git repository.

10. What is Jenkinsfile?

o A Jenkinsfile is a text file that contains the definition of a Jenkins pipeline.

11. What are Jenkins agents?

o Jenkins agents (or nodes) are machines that Jenkins can use to execute jobs.

12. How do you secure Jenkins?

o Implement authentication, authorization, and use security plugins like Role-based


Authorization Strategy.

13. What are Jenkins plugins?

o Jenkins plugins extend the functionality of Jenkins, such as integrating with version
control systems, CI/CD tools, and cloud providers.

14. How do you manage Jenkins plugins?

o Manage plugins via the Jenkins dashboard under "Manage Jenkins" > "Manage
Plugins."

15. What is Jenkins Master-Slave architecture?

o In this architecture, the Jenkins master manages the jobs, while slaves are machines
that perform the job execution.

16. How do you set up a Jenkins slave node?

o Configure a new node in "Manage Jenkins" > "Manage Nodes" and connect it to the
master.
17. What is a Jenkins build?

o A build in Jenkins is the execution of a Jenkins job.

18. How do you monitor Jenkins logs?

o Jenkins logs can be monitored via the Jenkins dashboard under "Manage Jenkins" >
"System Log" or by accessing the Jenkins log files directly.

19. How do you archive artifacts in Jenkins?

o Use the archiveArtifacts step in your Jenkins pipeline to specify which files or
directories should be archived.

20. What is the purpose of the post block in a Jenkins pipeline?

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.

2. What are Grafana dashboards?

o Dashboards in Grafana are collections of data visualizations, such as graphs and


charts, used to monitor metrics and trends over time.

3. How do you add a data source in Grafana?

o Add a data source by navigating to the Grafana settings, selecting the data source
type, and configuring the connection details.

4. What is Prometheus in Grafana?

o Prometheus is a popular open-source monitoring and alerting toolkit that integrates


with Grafana for visualizing metrics collected from various services.

5. How do you create a custom dashboard in Grafana?

o Create a custom dashboard by selecting the panels you need, configuring queries,
and arranging them according to your monitoring needs.

6. What is the purpose of alerting in Grafana?

o Alerting in Grafana allows you to set up rules that trigger notifications when certain
conditions are met, helping you respond to issues proactively.

7. How do you configure alerts in Grafana?

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 Panels are individual visualizations within a Grafana dashboard, such as graphs,


tables, or heatmaps, each displaying a specific metric or data query.

9. How do you manage users and permissions in Grafana?

o Manage users and permissions by creating user accounts, assigning roles (Admin,
Editor, Viewer), and configuring access controls for dashboards and data sources.

10. What is Grafana Loki?

o Loki is a log aggregation system designed to work with Grafana, enabling you to
visualize and search logs alongside metrics.

11. How do you set up Grafana with Docker?

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.

12. What is a Grafana plugin?

o Grafana plugins are extensions that add new data sources, panels, and apps,
allowing you to extend Grafana's capabilities.

13. How do you export and import Grafana dashboards?

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.

14. What is Grafana's role in DevOps?

o Grafana plays a crucial role in DevOps by providing real-time monitoring and


visualization of infrastructure, application performance, and logs, aiding in incident
response and optimization.

15. How do you monitor Kubernetes with Grafana?

o Monitor Kubernetes with Grafana by integrating it with Prometheus and using


Kubernetes-specific Grafana dashboards to visualize cluster health and performance
metrics.

16. What is the difference between Grafana and Kibana?

o Grafana is focused on monitoring and visualization of metrics, while Kibana is


designed for exploring and visualizing log data in the Elastic Stack.

17. How do you customize Grafana themes?

o Customize Grafana themes by selecting built-in light or dark modes or by creating


custom themes using CSS overrides.

18. How do you manage Grafana's performance?

o Manage performance by optimizing queries, using efficient data sources, and scaling
the Grafana deployment to handle large amounts of data and users.

19. What is Grafana Tempo?


o Tempo is an open-source, scalable distributed tracing backend that integrates with
Grafana, allowing you to visualize traces alongside metrics and logs.

20. How do you secure a Grafana instance?

o Secure Grafana by enabling authentication, configuring HTTPS, setting up user roles


and permissions, and monitoring access logs for suspicious activity.

You might also like