55
Troubleshooting Reference Guide
| Problem | First Checks | Likely Resolution Direction |
|---|---|---|
| Nothing to commit | git status / diff | No changes made or already committed |
| Push rejected | git fetch / log | Remote branch has newer history; fetch & integrate |
| Authentication failed | ssh -T / gh auth status | Expired token, wrong URL or missing SSH key |
| Merge conflict | git status / diff | Resolve unmerged conflict paths manually |
| Detached HEAD | git status | Switch back to branch or create new recovery branch |
| Lost commit | git reflog | Find lost SHA in reflog and recreate branch |
| Secret detected | Rotate credential first! | Rotate key, remove from code, remediate git history |
56
Real Development Workflow
🔄 Enterprise Development Workflow Flowchart
Task / Issue
Planning
Planning
➔
Feature Branch
Development
Development
➔
Commit + Push
Upload
Upload
➔
Pull Request
Review
Review
➔
CI + Review
Automated Gate
Automated Gate
➔
Merge & Deploy
Release
Release
57
10 Complete Practical Portfolio Projects
🚀 Practical Projects List
- 1. Portfolio Website — README + project code + issues + PR + Actions CI
- 2. Python API Pipeline — Tests + lint + matrix CI + artifact upload
- 3. Node Application — npm CI + build + release workflow
- 4. Docker Application — Build image + scan vulnerabilities + publish to GHCR
- 5. Database Integration — Actions service container (PostgreSQL) + integration tests
- 6. Release Pipeline — Tag ➔ build ➔ test ➔ GitHub Release
- 7. Open-Source Contribution — Fork ➔ branch ➔ PR ➔ review
- 8. DevSecOps Repo — Secret scanning + dependency scanning + protected main
- 9. Reusable CI Platform — Reusable workflow matrix used by multiple repos
- 10. Documentation Site — Markdown docs + GitHub Pages publishing workflow
58 & 59
150+ Interview Questions & Scenario-Based Answers
🎯 Key Scenario Answers
Scenario: Bad commit merged to main? Do not rewrite shared history. Assess impact, revert the bad commit (`git revert SHA`), run CI checks, communicate with team, then fix forward.
Scenario: Secret committed? Rotate and revoke credentials immediately! Investigate exposure, remove secret from current code, remediate Git history if required, and enable secret scanning push protection.
Scenario: Secret committed? Rotate and revoke credentials immediately! Investigate exposure, remove secret from current code, remediate Git history if required, and enable secret scanning push protection.
60
Master Command Cheat Sheet
// DAILY WORKFLOW
git status
git switch main
git pull --ff-only
git switch -c feature/name
git diff
git add .
git commit -m "feat: description"
git push -u origin feature/name
// UNDO & RECOVERY
git restore file
git restore --staged file
git revert SHA
git reset --soft HEAD~1
git reset --hard HEAD~1
git reflog
// GITHUB CLI
gh auth status
gh repo clone OWNER/REPO
gh issue list
gh pr create
gh pr checkout 123
gh pr review 123 --approve
61 & 62
30/60/90 Day Roadmap & Final Readiness Checklist
🇬🇧 90-Day Roadmap
Days 1–15: Git basics, commits, branches, merge, rebase & reflog.
Days 16–30: GitHub PRs, Code Review, CODEOWNERS & rulesets.
Days 31–45: Actions YAML workflows, matrix builds & caching.
Days 46–60: CD pipelines, environments, service containers.
Days 61–75: DevSecOps, secret scanning, Dependabot & GHCR.
Days 76–90: CLI, REST/GraphQL APIs, webhooks & monorepos.
Days 16–30: GitHub PRs, Code Review, CODEOWNERS & rulesets.
Days 31–45: Actions YAML workflows, matrix builds & caching.
Days 46–60: CD pipelines, environments, service containers.
Days 61–75: DevSecOps, secret scanning, Dependabot & GHCR.
Days 76–90: CLI, REST/GraphQL APIs, webhooks & monorepos.
🇮🇳 Golden Rule
Before executing a destructive Git command, know exactly which history it alters and how you will recover it using reflog or revert!