GitHub vs Bitbucket vs GitLab : comparaison complète
DOG&DEV · 26/01/2025
GitHub vs Bitbucket vs GitLab : comparaison complète
Le choix entre GitHub, Bitbucket et GitLab dépend de vos besoins spécifiques. Chaque plateforme a ses forces : GitHub pour l'écosystème, Bitbucket pour l'intégration Atlassian, GitLab pour l'all-in-one. Ce guide compare en détail les trois.
Prérequis
- Compréhension de base de Git
- Connaissances en développement logiciel
Vue d'ensemble
GitHub
Développeur : Microsoft (acquis en 2018)
Points forts :
- Écosystème : le plus grand, nombreuses intégrations
- Communauté : standard de l'industrie
- Actions : CI/CD intégré
- Packages : registre de paquets
Bitbucket
Développeur : Atlassian
Points forts :
- Intégration Atlassian : Jira, Confluence, Trello
- Mercurial : support Git + Mercurial
- Pipelines : CI/CD intégré
- Prix : plan gratuit généreux
GitLab
Développeur : GitLab Inc.
Points forts :
- All-in-one : Git, CI/CD, sécurité, monitoring
- Self-hosted : version open source complète
- DevOps : plateforme DevOps complète
- Flexibilité : très personnalisable
Comparaison détaillée
Fonctionnalités Git
| Fonctionnalité | GitHub | Bitbucket | GitLab |
|---|---|---|---|
| Repositories privés | ✅ Illimités | ✅ Illimités | ✅ Illimités |
| Collaborateurs | ✅ | ✅ | ✅ |
| Pull Requests | ✅ | ✅ (Merge Requests) | ✅ (Merge Requests) |
| Issues | ✅ | ✅ | ✅ |
| Wiki | ✅ | ✅ | ✅ |
| Pages | ✅ | ✅ | ✅ |
Verdict : Les trois offrent des fonctionnalités Git similaires.
CI/CD
GitHub Actions
Avantages :
- Intégré : directement dans GitHub
- Marketplace : nombreuses actions pré-faites
- Gratuit : 2000 minutes/mois sur plan gratuit
Exemple :
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: npm test
Bitbucket Pipelines
Avantages :
- Intégré : dans Bitbucket
- Docker : support natif
- Gratuit : 50 minutes/mois sur plan gratuit
Exemple :
image: node:16
pipelines:
default:
- step:
script:
- npm install
- npm test
GitLab CI/CD
Avantages :
- Très puissant : pipelines avancés
- Auto DevOps : configuration automatique
- Gratuit : 400 minutes/mois sur plan gratuit
Exemple :
stages:
- test
- deploy
test:
stage: test
script:
- npm test
Verdict : GitLab pour la puissance, GitHub pour l'écosystème, Bitbucket pour la simplicité.
Tarification
Plan gratuit
GitHub :
- Repos privés illimités
- 3 collaborateurs max par repo privé
- 2000 minutes Actions/mois
- 500 Mo storage, 1 Go transfert Packages
Bitbucket :
- Repos privés illimités
- 5 utilisateurs max
- 50 minutes Pipelines/mois
- 1 Go storage LFS
GitLab :
- Repos privés illimités
- Utilisateurs illimités
- 400 minutes CI/CD/mois
- 5 Go storage
Plans payants
GitHub : à partir de 4$/mois/utilisateur Bitbucket : à partir de 3$/mois/utilisateur GitLab : à partir de 4$/mois/utilisateur
Verdict : Bitbucket le moins cher, GitLab le plus généreux en gratuit.
Intégrations
GitHub
Écosystème :
- Actions marketplace : milliers d'actions
- Apps : nombreuses intégrations tierces
- API : très complète
Intégrations populaires :
- Slack, Discord, Jira, Trello
- AWS, Azure, GCP
- Docker Hub, npm
Bitbucket
Intégration Atlassian :
- Jira : intégration native
- Confluence : documentation liée
- Trello : gestion de projet
Autres :
- Slack, Microsoft Teams
- AWS, Azure
GitLab
Intégrations :
- Slack, Mattermost
- Jira, Trello
- Kubernetes, Docker
- Prometheus, Grafana
Verdict : GitHub pour l'écosystème, Bitbucket pour Atlassian, GitLab pour DevOps.
Sécurité
GitHub
- Dependabot : alertes vulnérabilités
- Code scanning : analyse de code
- Secret scanning : détection secrets
- 2FA : authentification à deux facteurs
Bitbucket
- Security advisories : alertes sécurité
- 2FA : authentification à deux facteurs
- IP whitelisting : restrictions IP
GitLab
- Security scanning : analyse sécurité
- Dependency scanning : vulnérabilités dépendances
- Container scanning : scan images Docker
- 2FA : authentification à deux facteurs
Verdict : GitLab le plus complet, GitHub très bon, Bitbucket correct.
Self-hosting
GitHub
- GitHub Enterprise Server : version self-hosted (payant)
- Pas d'open source : code propriétaire
Bitbucket
- Bitbucket Data Center : version self-hosted (payant)
- Pas d'open source
GitLab
- GitLab Community Edition : version open source gratuite
- GitLab Enterprise Edition : version payante avec fonctionnalités avancées
- Self-hosting : très populaire
Verdict : GitLab gagne clairement (open source + self-hosting).
Cas d'usage
Choisissez GitHub si
- ✅ Projet open source : écosystème le plus large
- ✅ Intégrations nombreuses : besoin de beaucoup d'intégrations
- ✅ Communauté : visibilité maximale
- ✅ Actions : CI/CD simple et efficace
Choisissez Bitbucket si
- ✅ Stack Atlassian : utilisez Jira, Confluence
- ✅ Petite équipe : plan gratuit généreux
- ✅ Simplicité : interface simple
- ✅ Mercurial : besoin de support Mercurial
Choisissez GitLab si
- ✅ DevOps complet : besoin d'une plateforme all-in-one
- ✅ Self-hosting : hébergement sur vos serveurs
- ✅ Pipelines avancés : CI/CD complexe
- ✅ Sécurité : besoins de sécurité avancés
Migration entre plateformes
GitHub → GitLab
# Cloner depuis GitHub
git clone --mirror https://github.com/user/repo.git
cd repo.git
# Pousser vers GitLab
git remote set-url --push origin https://gitlab.com/user/repo.git
git push --mirror
Bitbucket → GitHub
Via interface : Bitbucket propose un outil de migration vers GitHub.
Manuellement :
git clone --mirror https://bitbucket.org/user/repo.git
cd repo.git
git remote set-url --push origin https://github.com/user/repo.git
git push --mirror
Dépannage
| Problème | Plateforme | Solution |
|---|---|---|
| CI/CD trop lent | Toutes | Optimiser pipelines ; utiliser cache |
| Coûts élevés | Toutes | Passer à self-hosted (GitLab) ; optimiser usage |
| Intégrations manquantes | Bitbucket/GitLab | Utiliser webhooks ; API personnalisée |
Bonnes pratiques
- Backup : sauvegarder régulièrement vos repos
- 2FA : activer l'authentification à deux facteurs
- Branches protégées : protéger les branches principales
- Code review : exiger des reviews avant merge
- Documentation : maintenir README et wiki à jour
Ressources
- cicd-laravel-github-actions - CI/CD avec GitHub Actions
- Documentation GitHub
- Documentation GitLab
- Documentation Bitbucket
Cet article s'inscrit dans notre série de guides développement et outils. Pour un projet sur-mesure, contact.