Lesson 02 — GitHub
Lesson 02 — GitHub
Section titled “Lesson 02 — GitHub”Lesson Overview
Section titled “Lesson Overview”Git allows you to track changes locally on your computer.
But what happens when:
- You want to work from another computer?
- Your laptop crashes?
- Your team needs access to your project?
- You want to contribute to open-source software?
- You need automated CI/CD pipelines?
This is where GitHub comes in.
GitHub is the world’s largest platform for hosting Git repositories and collaborating on software projects.
Millions of developers, Cloud Engineers, DevOps Engineers, Security Engineers, AI Engineers, and organizations use GitHub every day to build, review, secure, and deploy software.
Throughout your GoHackersCloud Academy journey, GitHub will become your primary platform for managing code, documentation, labs, Infrastructure as Code, and automation projects.
Learning Objectives
Section titled “Learning Objectives”After completing this lesson, you will be able to:
- Understand GitHub and its purpose.
- Create GitHub repositories.
- Connect local Git repositories to GitHub.
- Push and pull code.
- Clone repositories.
- Understand branches.
- Work with Pull Requests.
- Use Issues.
- Understand GitHub collaboration.
- Apply GitHub in enterprise DevOps workflows.
What is GitHub?
Section titled “What is GitHub?”GitHub is a cloud-based platform that hosts Git repositories.
It provides:
- Remote code storage
- Collaboration
- Version control
- Code reviews
- CI/CD integration
- Security scanning
- Documentation
- Project management
Think of GitHub as the online home for your Git repositories.
Git vs GitHub
Section titled “Git vs GitHub”Many beginners confuse Git and GitHub.
| Git | GitHub |
|---|---|
| Version Control System | Cloud Hosting Platform |
| Installed on your computer | Web application |
| Tracks changes | Stores repositories online |
| Works offline | Requires internet for synchronization |
| Developed by Linus Torvalds | Owned by Microsoft |
Git is the tool.
GitHub is the collaboration platform.
Why GitHub Matters
Section titled “Why GitHub Matters”GitHub enables developers to:
- Backup projects
- Collaborate globally
- Review code
- Track issues
- Automate deployments
- Share open-source projects
- Build professional portfolios
Most enterprise software development relies on GitHub or similar platforms.
GitHub Workflow
Section titled “GitHub Workflow”Developer
↓
Local Git Repository
↓
GitHub Repository
↓
Team Collaboration
↓
DeploymentGitHub acts as the central collaboration platform.
Creating a GitHub Account
Section titled “Creating a GitHub Account”Visit:
https://github.comCreate a free account.
Choose:
- Username
- Email Address
- Password
Verify your email address.
Once registered, you’re ready to create repositories.
Creating a Repository
Section titled “Creating a Repository”Select:
New RepositoryEnter:
- Repository Name
- Description
- Public or Private
- README
- License (Optional)
Click:
Create RepositoryGitHub creates an empty remote repository.
Repository Structure
Section titled “Repository Structure”Example:
GoHackersCloud-Labs/
│
├── README.md
├── docs/
├── src/
├── scripts/
├── .gitignore
└── LICENSEA well-organized repository is easier to maintain and collaborate on.
Cloning a Repository
Section titled “Cloning a Repository”Download a repository to your computer.
git clone https://github.com/user/project.gitGit downloads:
- Files
- Commit history
- Branches
You now have a complete local copy.
Connecting Local Git to GitHub
Section titled “Connecting Local Git to GitHub”After creating a local repository:
git remote add origin https://github.com/user/project.gitVerify:
git remote -vGit now knows where the remote repository is located.
Pushing Code
Section titled “Pushing Code”Upload local commits to GitHub.
git push origin mainWorkflow:
Local Repository
↓
GitHub RepositoryYour project is now backed up online.
Pulling Changes
Section titled “Pulling Changes”Download updates from GitHub.
git pull origin mainWorkflow:
GitHub
↓
Local ComputerAlways pull the latest changes before starting work.
Fetch vs Pull
Section titled “Fetch vs Pull”Fetch
git fetchDownloads changes but does not merge them.
Pull
git pullDownloads and merges changes automatically.
Branches
Section titled “Branches”A branch allows independent development.
Example:
main
|
|--- feature-login
|
|--- feature-dashboard
|
|--- bugfix-authenticationBranches isolate work until it is ready.
Creating a Branch
Section titled “Creating a Branch”git branch feature-loginSwitch:
git checkout feature-loginOr:
git switch feature-loginMerging Branches
Section titled “Merging Branches”Once work is complete:
git checkout main
git merge feature-loginThe feature becomes part of the main project.
Pull Requests
Section titled “Pull Requests”A Pull Request (PR) requests that changes from one branch be merged into another.
Typical workflow:
Developer
↓
Feature Branch
↓
Pull Request
↓
Code Review
↓
Approval
↓
MergePull Requests improve code quality and collaboration.
Code Reviews
Section titled “Code Reviews”Before merging code, teammates review:
- Logic
- Security
- Style
- Documentation
- Performance
Code reviews reduce bugs and improve maintainability.
GitHub Issues
Section titled “GitHub Issues”Issues help teams manage work.
Example:
Bug Report
Feature Request
Documentation Update
Security IssueEach issue can be assigned, prioritized, and tracked.
Labels
Section titled “Labels”GitHub labels organize issues.
Examples:
- Bug
- Enhancement
- Documentation
- Security
- Help Wanted
Labels improve project management.
Milestones
Section titled “Milestones”Milestones group issues into releases.
Example:
Version 1.0
↓
20 Issues
↓
ReleaseMilestones help teams plan development.
README.md
Section titled “README.md”Every repository should include a README.
Typical contents:
- Project Overview
- Installation
- Usage
- Screenshots
- Documentation
- Contributing
- License
The README is often the first thing users read.
.gitignore
Section titled “.gitignore”Ignore unnecessary files.
Example:
venv/
__pycache__/
*.log
.env
node_modules/Never commit temporary files or secrets.
GitHub in Cloud Computing
Section titled “GitHub in Cloud Computing”Cloud Engineers use GitHub to manage:
- Terraform
- CloudFormation
- Kubernetes YAML
- AWS Lambda
- Infrastructure Scripts
- Cloud Documentation
Infrastructure becomes version-controlled and auditable.
GitHub in DevOps
Section titled “GitHub in DevOps”DevOps Engineers store:
- CI/CD Pipelines
- Dockerfiles
- Kubernetes Manifests
- Deployment Scripts
- Configuration Files
GitHub integrates directly with automation platforms.
GitHub in Cybersecurity
Section titled “GitHub in Cybersecurity”Security teams manage:
- Detection Rules
- Threat Hunting Scripts
- Incident Response Playbooks
- Security Automation
- Compliance Documentation
GitHub provides version history and collaboration.
GitHub in AI
Section titled “GitHub in AI”AI Engineers use GitHub for:
- Python Projects
- Machine Learning Models
- Jupyter Notebooks
- Experiment Tracking
- Documentation
GitHub simplifies collaboration on AI projects.
GitHub Actions (Introduction)
Section titled “GitHub Actions (Introduction)”GitHub includes built-in automation called GitHub Actions.
Examples:
- Run tests
- Build applications
- Deploy infrastructure
- Scan security vulnerabilities
You’ll explore CI/CD in later lessons.
Common GitHub Features
Section titled “Common GitHub Features”| Feature | Purpose |
|---|---|
| Repository | Store projects |
| Branch | Isolate development |
| Pull Request | Review and merge code |
| Issues | Track work |
| Wiki | Documentation |
| Releases | Publish software versions |
| Actions | CI/CD Automation |
| Security | Dependency & code scanning |
Common Beginner Mistakes
Section titled “Common Beginner Mistakes”Avoid these mistakes:
- Pushing directly to
main. - Forgetting to pull before pushing.
- Committing sensitive information.
- Ignoring
.gitignore. - Creating unclear repository names.
- Writing poor commit messages.
Following GitHub best practices improves collaboration and security.
Enterprise Best Practices
Section titled “Enterprise Best Practices”Professional teams:
- Protect the
mainbranch. - Use feature branches.
- Require Pull Requests.
- Review all code.
- Enable branch protection.
- Automate testing with GitHub Actions.
- Store secrets securely.
- Keep documentation up to date.
These practices improve software quality and team productivity.
Real-World Example
Section titled “Real-World Example”A DevOps Engineer updates a Kubernetes deployment.
Workflow:
Modify YAML
↓
Commit Changes
↓
Push to GitHub
↓
Create Pull Request
↓
Team Review
↓
Merge
↓
CI/CD Pipeline Deploys
↓
Production UpdatedGitHub becomes the central platform for collaboration and deployment.
Key Takeaways
Section titled “Key Takeaways”After completing this lesson, you should understand:
- GitHub
- Remote repositories
- Clone
- Push
- Pull
- Fetch
- Branches
- Pull Requests
- Issues
- Repository management
- GitHub collaboration
Summary
Section titled “Summary”GitHub extends the power of Git by providing a secure, cloud-based collaboration platform for developers and IT professionals.
By hosting repositories, enabling collaboration, integrating automation, and supporting enterprise workflows, GitHub has become an essential platform for modern Cloud Computing, DevOps, Artificial Intelligence, and Cybersecurity.
Mastering GitHub prepares you to work effectively in professional software development teams and contribute to enterprise and open-source projects.
Next Lesson
Section titled “Next Lesson”➡️ Lesson 03 — Markdown
In the next lesson, you’ll learn Markdown, the lightweight markup language used to create professional documentation on GitHub. You’ll write README files, project documentation, technical guides, and knowledge bases—the same format used throughout GoHackersCloud Academy and most modern software projects.