> For the complete documentation index, see [llms.txt](https://asafahmadov.gitbook.io/cloud-and-devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/version-control-with-git/git-for-devops.md).

# Git for Devops

### Use Case 1) Infrastructure as Code

**As a DevOps engineer you write code (configuration files and scripts) to create and provision infrastructure**

&#x20;   ▪ Kubernetes config files.

&#x20;   ▪ Terraform and Ansible config files.

&#x20;   ▪ Bash and Python scripts.

<mark style="color:red;">**Just like software code, files should be:**</mark>&#x20;

&#x20;   ▪ Tracked - history of changes (these files should also "live" in a remote repository and be tracked and versioned by Git)

&#x20;   ▪ Securely stored in one place.&#x20;

&#x20;   ▪ Shareable to collaborate as team.

### Use Case 2) Automation Scripts

**As a DevOps engineer you write automation scripts e.g. with Python or Bash to automate different tasks**

### Use Case 3) CI/CD Pipeline and Build Automation

&#x20;   ▪ CI means: On each merge, checkout code from repository, test and build application

&#x20;   ▪ For that, you need integration for the build automation tool with application git repository&#x20;

&#x20;   ▪ You need to setup integration with build automation tool and git repository&#x20;

&#x20;   ▪ You need to know git commands for example for:

&#x20;       ● `getting commit hash of specific commit`&#x20;

&#x20;       ● `check if changes happen in frontend or backend code`
