Agar DevOps ka backbone kuch hai, toh woh Git hai.
Automation scripts, Docker files, CI/CD pipelines — sab Git ke bina meaningless hain.
Version control ka matlab:
Git bina DevOps possible nahi hai.
Production systems me “undo” sirf Git deta hai.
sudo apt update
sudo apt install git -y
git --version
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
Ye identity commits ke sath store hoti hai.
mkdir devops-project
cd devops-project
git init
Ab ye folder Git controlled ho gaya.
echo "DevOps Learning" > readme.txt
git status
git add .
git commit -m "Initial commit"
Commit = snapshot of your project.
DevOps automation always follows this flow.
git branch dev
git checkout dev
Production directly edit karna suicide hai. Branches safety dete hain.
git checkout main
git merge dev
CI/CD pipelines yahin se start hoti hain.
Git local hota hai, GitHub cloud me hota hai.
git remote add origin https://github.com/username/repo.git
git push -u origin main
Git discipline = DevOps discipline.
Ab jab code versioned hai, next step hai Containers.
Next Part → Docker & Containers