mirror of
https://github.com/thecyberlearn/devops-notes.git
synced 2026-08-18 07:32:51 +00:00
1.6 KiB
1.6 KiB
GitHub – DevOps Workflow (Day 10)
What is GitHub?
GitHub is a cloud platform to host Git repositories. It allows teams to collaborate, review code, and trigger CI/CD pipelines.
DevOps engineers use GitHub daily.
Why GitHub is Important for DevOps?
- Central code storage
- Team collaboration
- CI/CD integration
- Code reviews and approvals
Create GitHub Account
Go to https://github.com and create a free account.
Connect Local Repository to GitHub
Create a new repository on GitHub (do NOT add README).
Then run:
git remote add origin https://github.com/username/repo-name.git
Verify:
git remote -v
Push Code to GitHub
git push -u origin main
Clone a Repository
git clone https://github.com/username/repo-name.git
Pull Latest Changes
git pull origin main
GitHub DevOps Workflow
- Create feature branch
- Push branch to GitHub
- Open Pull Request
- Code review & approval
- Merge to main
- CI/CD deploys automatically
Pull Requests (PR)
A Pull Request is a request to merge code into the main branch. Used for safe deployments and team collaboration.
Real DevOps Scenario
Multiple developers working together:
- Everyone works on own branch
- PRs ensure stability
- CI checks before merge
Common Mistakes
- Pushing directly to main
- Not pulling latest changes
- Ignoring PR reviews
DevOps Rule
✅ Always use Pull Requests
❌ Never push directly to main
Summary
Today I learned GitHub basics for DevOps including clone, push, pull, and Pull Request workflow used in real companies.