Git Hosting Platforms
Platforms provide cloud hosting for repositories plus collaboration features.
The Big Three
| Platform | Launched | Users | Best For |
|---|---|---|---|
| GitHub | 2008 | 100M+ | Open source, popular projects |
| GitLab | 2011 | 10M+ | Enterprise, self-hosted |
| Bitbucket | 2008 | Enterprise | Teams using Jira |
GitHub
Features
- Collaborative: Pull requests, code review
- Social: Stars, following developers
- Ecosystem: Massive open source community
- CI/CD: GitHub Actions built-in
- Permissions: Granular access control
Key Concepts
Repositories:
# Clone from GitHub
git clone https://github.com/user/repository.gitPull Requests:
- Propose changes
- Code review with comments
- Merge via UI
Issues:
- Bug tracking
- Feature requests
- Project planning
GitHub Actions
Automated workflows (CI/CD):
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm testGitHub Organizations
For team repositories:
# Organization repo
git clone https://github.com/mycompany/project.git
# Team members with roles:
# Owner, Maintainer, Member, GuestGitLab
Features
- Self-hosted: Control your own server
- All-in-one: Project management + CI/CD + security
- Enterprise: Advanced permissions, audit logs
- DevOps: Built-in container registry
Key Differences from GitHub
Merge Requests (like PRs):
# Similar workflow but called MR
# More advanced approval rules
# Squash commits option built-inRunners (like Actions):
# .gitlab-ci.yml
test:
script:
- npm test
runner:
- dockerNamespaces:
- Groups (like GitHub Orgs)
- Better nested structure
Strengths
- ✅ Self-hosted option
- ✅ Better for enterprise
- ✅ More features out-of-box
- ✅ Container registry included
Bitbucket
Features
- Jira Integration: Seamless with project management
- Pipelines: Built-in CI/CD
- Permissions: Repository-level access control
- Code insights: Analytics and metrics
When to Use
- ✅ Already using Jira
- ✅ Enterprise Atlassian stack
- ✅ Team of 10-1000 people
- ❌ Large open source projects
- ❌ Smaller startups
Comparing Platforms
Cost
| Platform | Pricing | Free Tier |
|---|---|---|
| GitHub | Free + Pro + Enterprise | ✅ Unlimited public/private |
| GitLab | Free + Premium + Ultimate | ✅ 5GB storage |
| Bitbucket | Free + Pro + Enterprise | ✅ $5/user/month |
For Open Source
GitHub: Easiest, largest community, most stars
# Get visibility, contributors, stars
# Main platform for open sourceFor Enterprise
GitLab: Best if self-hosting needed
# Run on your servers
# All company data stays internalFor Teams with Jira
Bitbucket: Seamless integration
# Pull requests link to Jira issues
# Dashboard integratedCommon Workflows Across Platforms
Creating Repository
GitHub:
- Dashboard → New Repository
- Initialize with README
- Clone to computer
GitLab:
- Projects → New Project
- Blank project or import
- Clone to computer
Adding Collaborators
GitHub:
- Settings → Collaborators
- Add by username
- Choose role (Pull/Push/Admin)
GitLab:
- Project → Members
- Add user with role
- Owner/Maintainer/Developer/Guest
Setting Branch Protection
# Prevent pushing directly to main
# GitHub:
# Settings → Branches → Main → Add rule
# - Require pull request reviews
# - Require status checks to pass
# GitLab:
# Project → Protected branches → Main
# - Require code owner approval
# - Require all discussions resolvedMigration Between Platforms
GitHub to GitLab
# 1. Mirror the repo (keep history)
git clone --mirror https://github.com/user/repo.git
# 2. Push to GitLab
cd repo.git
git push --mirror https://gitlab.com/user/repo.git
# 3. Clone normally and work
git clone https://gitlab.com/user/repo.gitGitLab to GitHub
# Same process, swap URLsCommunity and Ecosystem
GitHub Advantages
- ✅ Largest open source community
- ✅ Most packages (npm, GitHub Packages)
- ✅ Easiest to find help
- ✅ Most integrations
- ✅ Best for portfolio/resume
GitLab Advantages
- ✅ Can self-host
- ✅ More features built-in
- ✅ Better for DevOps teams
- ✅ All-in-one platform
Bitbucket Advantages
- ✅ Best Jira integration
- ✅ Enterprise support
- ✅ Integrated pipelines
- ✅ Team-focused
Choosing a Platform
Are you on Atlassian stack?
├─ Yes → Bitbucket
└─ No
Do you need self-hosting?
├─ Yes → GitLab
└─ No
Building open source?
├─ Yes → GitHub
└─ No → GitHub (most popular)
Best Practices
Repository Settings
- ✅ Add
.gitignoreat creation - ✅ Add
README.mdwith description - ✅ Add
LICENSEfile - ✅ Enable branch protection on main
- ✅ Require code review before merge
- ✅ Add CONTRIBUTING guide
Organization
- ✅ Clear branch naming
- ✅ Consistent commit messages
- ✅ Regular code reviews
- ✅ Automated testing
- ✅ Automated deployment
Security
- ✅ Never commit secrets
- ✅ Use
.envfor configuration - ✅ Review contributor permissions
- ✅ Enable two-factor authentication
- ✅ Rotate credentials regularly
Future of Platforms
Trends:
- AI-assisted: Copilot suggestions
- Security: Dependency scanning
- Performance: Container registries
- Collaboration: Better code review
- DevOps: Integrated deployment
All platforms converging on similar features.
Tips
✓ GitHub for open source and community
✓ GitLab for self-hosted/enterprise
✓ Bitbucket for Jira teams
✓ Use branch protection rules
✓ Automate testing and deployment
✓ Require code review
✓ Keep README up to date