What is GitHub?
GitHub is the world's largest platform for hosting and collaborating on code. Built on top of Git version control system, it provides a web interface for managing repositories, tracking changes, collaborating with team members, and deploying applications.
Key Features
Repositories
Storage spaces for your project files, including code, documentation, and version history.
Pull Requests
Propose changes to code, review modifications, and merge updates collaboratively.
Issues
Track bugs, feature requests, and project tasks with labels, assignees, and milestones.
Actions
Automate workflows for CI/CD, testing, and deployment directly from your repository.
Pages
Host static websites directly from your GitHub repository for free.
Essential Git Commands
# Clone a repository
git clone https://github.com/username/repository.git
# Check status
git status
# Add files to staging
git add .
git add filename.js
# Commit changes
git commit -m "Add new feature"
# Push to GitHub
git push origin main
# Pull latest changes
git pull origin main
# Create and switch to new branch
git checkout -b feature-branch
# Merge branches
git merge feature-branch
GitHub Workflow
- Fork: Create a copy of a repository to your account
- Clone: Download the repository to your local machine
- Branch: Create a new branch for your feature or fix
- Commit: Save your changes with descriptive messages
- Push: Upload your changes to GitHub
- Pull Request: Request to merge your changes
- Review: Team members review and approve changes
- Merge: Integrate approved changes into main branch