Zwei Philosophien
Subversion (SVN), 2000 veroffentlicht, ist ein zentralisiertes Versionskontrollsystem. Git, 2005 veroffentlicht, ist verteilt.
Mentale Modelle
SVN's mentales Modell ist der Aktenschrank. Git's Modell ist eher wie E-Mail.
Was SVN richtig gemacht hat
- Einfach zu erklaren.
- Feingranulare Zugriffskontrolle.
- File-Locking fur unmergeable Binaries.
- Lineare Revisionsnummern.
- Stabil fur sehr grosse Repositories.
Was Git richtig gemacht hat
- Gunstige, schnelle Branches und Merges.
- Volle lokale Historie.
- Verteiltes Modell.
- SHA-basiertes Content-Addressing.
- Riesiges Okosystem.
Tagliche Befehle im Vergleich
# SVN
svn checkout https://svn.example.com/repo
svn update
svn add file.txt
svn commit -m "Add file"
svn log
# Git
git clone https://git.example.com/repo.git
git pull
git add file.txt
git commit -m "Add file"
git push
git log
Branching
# SVN branch
svn copy https://svn.example.com/repo/trunk \
https://svn.example.com/repo/branches/feature -m "Branch"
# Git branch
git checkout -b feature
Warum Git Marktanteile gewann
Drei Faktoren: GitHubs Netzwerkeffekte ab 2008, die Dominanz von Linux und die Wahl von Git, und der Aufstieg der Cloud.
Wann SVN sinnvoll bleibt
- Grosse Binar-Repositories.
- Streng kontrollierte Umgebungen.
- Etablierte Tooling-Pipelines.