SlideShare ist ein Scribd-Unternehmen logo
1 von 45
k o m mu n ik at ion & sys teme




        Einstieg SVN
Grundlagen zur Versionskontrolle mit Subversion




           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                      • Freie Software zur Versionsverwaltung
                      • Versionsverwaltung ist ein System zur Erfassung von
                              Änderungen an Dokumenten



                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Zentrales Repository




                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                      • SVN unterscheidet nur zwischen Verzeichnissen und
                              Dateien
                      • Es werden immer nur Änderungen übertragen und
                              gespeichert
                      •       Jede Datei kann Eigenschaften besitzen

                                            Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      SVN Properties
           •      Bestehen aus Key-/Value-Pairs

           •      Externe Verweise
                  svn:externals

           •      Merge-Informationen
                  svn:mergeinfo

           •      Ignoreierte Dateien
                  svn:ignore



                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Übliche Struktur

                                       Sodbrennen
                                           /trunk
                                           /tags
                                               Version-1.0
                                               Version-1.1
                                           /branches
                                               Selbsttest

                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                            Ordner anlegen. Im SVN

                                      $ svn mkdir -m „Projektstruktur angelegt“
                                                 http://svnrepo/rennie/trunk
                                                 http://svnrepo/rennie/branches
                                                 http://svnrepo/rennie/tags
                                      Committed revision 3.
                                      $




                                                Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Branch-Systeme




                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Never Branch System

                      •       Tägliche Arbeit wird direkt in /trunk übertragen

                      •       Gelegentlich ist /trunk defekt, wenn eine ganze Serie von
                              Änderungen übertragen wird




                                              Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Never Branch System

                                        Sehr einfach zu handhaben
                                        Projekt kann jederzeit defekt sein




                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Always Branch System

                      •       Jeder arbeitet immer in seinem eigenen Branch.

                      •       Bei abgeschlossener Entwicklung und Tests werden die
                              Änderungen aus dem Branch in /trunk übernommen




                                              Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Always Branch System

                                        /trunk ist jederzeit extrem stabil
                                        Benutzer sind von einander isoliert

                                        Mehr merges als notwendig



                                            Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                           Branch When Needed System
            •       Tägliche Arbeit wird in /trunk committet

            •       Regel #1: /trunk ist Jederzeit lauffähig

            •       Regel #2: Ein Commit ist so irrelevant, dass er nicht von jemand
                    anderes überprüft werden muss

            •       Regel #3: Können Regel #1 oder Regel #2 nicht eingehalten werden,
                    wird ein Branch angelegt.




                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                           Branch When Needed System

                                      /trunk ist garantiert stabil
                                      Benutzer sind von einander isoliert




                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Kopieren im SVN

               $ svn copy -m „neuer Branch für Umbau. Ticket: SOD-123“
                          http://svnrepo/rennie/trunk
                          http://svnrepo/rennie/branches/Umbau
               Committed revision 4.
               Rennie $




                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                          Checkout
                       $ cd ~/Projekte
                       Projekte $ mkdir Rennie
                       Projekte $ cd Rennie
                       Rennie $ svn checkout
                                    http://svnrepo/rennie/branches/Umbau
                                    .
                       Checked out revision 4.
                       Rennie $




                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Die Workingcopy
                      • Lokale Kopie des ausgecheckten Repositorys
                      • Hier machen wir unsere Änderungen
                      • Änderungen können jederzeit mit svn revert
                              widerrufen werden
                      • Atomare Änderungen
                      • Mehrere Aufgaben nach und nach erledigen
                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Diff auf eine Datei




                                          Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                          Commit
      Rennie $ svn commit . -m „Zusammenfallende Divs gefixt. Siehe
               Ticket SOD-123“
      Sending        index.html
      Transmitting file data .
      Committed revision 5.
      Rennie $




                                      Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e



                                      Show Annotations




                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Verdammte Konflikte!




                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                        Wie entsteht ein Konflikt?
                      • Jemand die selbe Zeile geändert wie ich
                      • Jemand hat die Zeile entfernt, die ich geändert habe
                      • Die Datei die ich aktualisiert habe existiert nicht
                              mehr
                      • Eine Datei die ich gelöscht habe wurde editiert

                                      Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                   Konflikt nach einem Update
                       Rennie $ svn up
                       Conflict discovered in 'README'.
                       Select: (p) postpone, (df) diff-full, (e) edit,
                                (mc) mine-conflict, (tc) theirs-conflict,
                                (s) show all options: p
                       C    README
                       Updated to revision 13.
                       Summary of conflicts:
                         Text conflicts: 1
                       Rennie $


                                      Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Konflikte lösen

                      • Ein Konflikt sollte sofort gelöst werden
                      • Nach Lösung des Konflikts ausreichend testen
                      • NIE einen Konflikt einfach mit den eigenen
                              Änderungen überschreiben




                                          Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Änderungen verwerfen

                                         Rennie $ svn revert README
                                         Reverted 'README'
                                         Rennie $ svn update README
                                         At revision 13.
                                         Rennie $




                                             Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Konfliktete Datei




                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                              Mir Egal!

                                      Rennie $ cp README.mine README
                                      Rennie $ svn resolved README
                                      Resolved conflicted state of 'README'
                                      Rennie $




                                            Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Zusammenführen
                      1. Konfliktete Datei enthält Marker
                      2. Änderungen aus .mine und .r123 abgleichen
                      3. Mit anderem Entwickler zusammen setzen
                      4. Marker entfernen
                      5. Datei als resolved markieren


                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                 So kann das aussehen …

                                      12   <<<<<<<        .mine
                                      13   This is        fun stuff!
                                      14   =======
                                      15   This is        a documentation file
                                      16   >>>>>>>        .r13




                                             Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Zeit zu mergen




                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Zeit zu mergen

                      • Täglich: Um Branch aktuell zu halten
                      • Am Ende der Entwicklung: Um Änderungen in den
                              Trunk zu bringen
                      • Ggf. um gezielte Änderungen zu übernehmen



                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                              Vorgehensweise „Merge“
                      1.          Es sind keine lokalen Änderungen mehr vorhanden
                      2. Mit Arbeitskopie in Zielzweig switchen
                      3. Merge aus Quellzweig in lokale Arbeitskopie
                      4. Testen!
                      5. Commit der geänderten Dateien


                                              Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Keep up to date!
                  Rennie $ svn merge http://svnrepo/rennie/trunk

                  --- Merging r5 through r18 into '.':
                  A    neueDatei.php
                  U    index.html
                  Rennie $ svn commit . -m „Aktuellen Stand aus trunk
                           gemerged“
                  A    neueDatei.php
                  U    index.html
                  Committed revision 19.
                  Rennie $

                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Branch reintegrieren
                  Rennie $ svn switch http://svnrepo/rennie/trunk
                  D    neueDatei.php
                  U    index.html
                  Updated to revision 18.
                  Rennie $ svn merge --reintegrate
                                     http://svnrepo/rennie/branches/Umbau
                  --- Merging r5 through r18 into '.':
                  A    neueDatei.php
                  U    index.html
                  Rennie $ svn commit . -m „Umbau-Branch zurück gemerged“
                  ...
                  Committed revision 19.
                  Rennie $

                                          Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                            Visualisierung eines Projektes
                                               /branches/blubb
                                               6                                   10                  12

                 /branches/foo                      /branches/bar
                   2             3                    7                  9




      1                               4                         8                                 11             13        15
    /trunk


                                           5                                                                          14
                                  /tags/Version-1.0                                                         /tags/Version-1.1


                                                   Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Projekt exportieren




                                          Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Tag erstellen

      $ svn copy -m „Tag für Livedeploy erstellt. Ticket: SOD-123“
                 http://svnrepo/rennie/trunk
                 http://svnrepo/rennie/tags/Version-1.1
      Committed revision 20.
      Rennie $




                                       Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Tag exportieren

           Rennie $ svn export http://svnrepo/rennie/tags/Version-1.0
                        ~/Desktop/Rennie-1.0
           A      index.html
           A      neueDatei.php
           Exported revision 19.
           Rennie $




                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Diff zwischen Zweigen
                   Rennie $ svn diff http://svnrepo/rennie/tags/Version-1.0
                                http://svnrepo/rennie/tags/Version-1.1
                                --summarize
                   M      branches/Umbau/index.html
                   D      branches/Umbau/.DS_Store
                   M      branches/Umbau/
                   A      branches/Umbau/auth/login.php
                   Rennie $




                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Checkout auf Live

       Live $ svn checkout
                  https://trac.bainbits.net/ ... /tags/Version-1.1
                  customized
       A      customized/index.html
       A      customized/.DS_Store
       A      customized/irgendwas.php
       A      customized/auth/login.php
       Checked out revision 20.
       Live $

                                         Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Live updaten

                          Live $ svn switch ^/tags/Version-1.2 customized
                          M      customized/index.html
                          D      customized/.DS_Store
                          M      customized/
                          A      customized/auth/logout.php
                          Checked out revision 149.
                          Live $




                                        Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                               Tags für Live-Checkouts

                      • Bietet uns eine enorme Stabilität
                      • Erleichter uns den Schritt zurück zum vorherigen
                              Stand
                      • Dient als Dokumentation

                                      Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                   P.S. Commits von Live nicht
                      als Brainbits Benutzer!

                              Live $ svn commit --username mvanengelshoven .
                                                -m „So ists richtig“




                                           Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                      Viel Spass!



                                      Einstieg SVN – ©2011 Michael van Engelshoven
ko mm u n i k ati o n & s ys te m e




                                                               Quellen

                      •       Ariejan – How to resolve Subversion Conflicts
                              http://ariejan.net/2007/07/04/how-to-resolve-subversion-conflicts/

                      •       Wikipedia – Apache Subversion
                              http://de.wikipedia.org/wiki/Apache_Subversion

                      •       Apache SVN – Subversion best practices
                              http://svn.apache.org/repos/asf/subversion/trunk/doc/user/svn-best-practices.html




                                                          Einstieg SVN – ©2011 Michael van Engelshoven

Weitere ähnliche Inhalte

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Einstieg SVN

  • 1. k o m mu n ik at ion & sys teme Einstieg SVN Grundlagen zur Versionskontrolle mit Subversion Einstieg SVN – ©2011 Michael van Engelshoven
  • 2. ko mm u n i k ati o n & s ys te m e • Freie Software zur Versionsverwaltung • Versionsverwaltung ist ein System zur Erfassung von Änderungen an Dokumenten Einstieg SVN – ©2011 Michael van Engelshoven
  • 3. ko mm u n i k ati o n & s ys te m e Zentrales Repository Einstieg SVN – ©2011 Michael van Engelshoven
  • 4. ko mm u n i k ati o n & s ys te m e • SVN unterscheidet nur zwischen Verzeichnissen und Dateien • Es werden immer nur Änderungen übertragen und gespeichert • Jede Datei kann Eigenschaften besitzen Einstieg SVN – ©2011 Michael van Engelshoven
  • 5. ko mm u n i k ati o n & s ys te m e SVN Properties • Bestehen aus Key-/Value-Pairs • Externe Verweise svn:externals • Merge-Informationen svn:mergeinfo • Ignoreierte Dateien svn:ignore Einstieg SVN – ©2011 Michael van Engelshoven
  • 6. ko mm u n i k ati o n & s ys te m e Übliche Struktur Sodbrennen /trunk /tags Version-1.0 Version-1.1 /branches Selbsttest Einstieg SVN – ©2011 Michael van Engelshoven
  • 7. ko mm u n i k ati o n & s ys te m e Ordner anlegen. Im SVN $ svn mkdir -m „Projektstruktur angelegt“ http://svnrepo/rennie/trunk http://svnrepo/rennie/branches http://svnrepo/rennie/tags Committed revision 3. $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 8. ko mm u n i k ati o n & s ys te m e Branch-Systeme Einstieg SVN – ©2011 Michael van Engelshoven
  • 9. ko mm u n i k ati o n & s ys te m e Never Branch System • Tägliche Arbeit wird direkt in /trunk übertragen • Gelegentlich ist /trunk defekt, wenn eine ganze Serie von Änderungen übertragen wird Einstieg SVN – ©2011 Michael van Engelshoven
  • 10. ko mm u n i k ati o n & s ys te m e Never Branch System Sehr einfach zu handhaben Projekt kann jederzeit defekt sein Einstieg SVN – ©2011 Michael van Engelshoven
  • 11. ko mm u n i k ati o n & s ys te m e Always Branch System • Jeder arbeitet immer in seinem eigenen Branch. • Bei abgeschlossener Entwicklung und Tests werden die Änderungen aus dem Branch in /trunk übernommen Einstieg SVN – ©2011 Michael van Engelshoven
  • 12. ko mm u n i k ati o n & s ys te m e Always Branch System /trunk ist jederzeit extrem stabil Benutzer sind von einander isoliert Mehr merges als notwendig Einstieg SVN – ©2011 Michael van Engelshoven
  • 13. ko mm u n i k ati o n & s ys te m e Branch When Needed System • Tägliche Arbeit wird in /trunk committet • Regel #1: /trunk ist Jederzeit lauffähig • Regel #2: Ein Commit ist so irrelevant, dass er nicht von jemand anderes überprüft werden muss • Regel #3: Können Regel #1 oder Regel #2 nicht eingehalten werden, wird ein Branch angelegt. Einstieg SVN – ©2011 Michael van Engelshoven
  • 14. ko mm u n i k ati o n & s ys te m e Branch When Needed System /trunk ist garantiert stabil Benutzer sind von einander isoliert Einstieg SVN – ©2011 Michael van Engelshoven
  • 15. ko mm u n i k ati o n & s ys te m e Kopieren im SVN $ svn copy -m „neuer Branch für Umbau. Ticket: SOD-123“ http://svnrepo/rennie/trunk http://svnrepo/rennie/branches/Umbau Committed revision 4. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 16. ko mm u n i k ati o n & s ys te m e Checkout $ cd ~/Projekte Projekte $ mkdir Rennie Projekte $ cd Rennie Rennie $ svn checkout http://svnrepo/rennie/branches/Umbau . Checked out revision 4. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 17. ko mm u n i k ati o n & s ys te m e Die Workingcopy • Lokale Kopie des ausgecheckten Repositorys • Hier machen wir unsere Änderungen • Änderungen können jederzeit mit svn revert widerrufen werden • Atomare Änderungen • Mehrere Aufgaben nach und nach erledigen Einstieg SVN – ©2011 Michael van Engelshoven
  • 18. ko mm u n i k ati o n & s ys te m e Diff auf eine Datei Einstieg SVN – ©2011 Michael van Engelshoven
  • 19. ko mm u n i k ati o n & s ys te m e Commit Rennie $ svn commit . -m „Zusammenfallende Divs gefixt. Siehe Ticket SOD-123“ Sending index.html Transmitting file data . Committed revision 5. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 20. ko mm u n i k ati o n & s ys te m e Show Annotations Einstieg SVN – ©2011 Michael van Engelshoven
  • 21. ko mm u n i k ati o n & s ys te m e Verdammte Konflikte! Einstieg SVN – ©2011 Michael van Engelshoven
  • 22. ko mm u n i k ati o n & s ys te m e Wie entsteht ein Konflikt? • Jemand die selbe Zeile geändert wie ich • Jemand hat die Zeile entfernt, die ich geändert habe • Die Datei die ich aktualisiert habe existiert nicht mehr • Eine Datei die ich gelöscht habe wurde editiert Einstieg SVN – ©2011 Michael van Engelshoven
  • 23. ko mm u n i k ati o n & s ys te m e Konflikt nach einem Update Rennie $ svn up Conflict discovered in 'README'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p C README Updated to revision 13. Summary of conflicts: Text conflicts: 1 Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 24. ko mm u n i k ati o n & s ys te m e Konflikte lösen • Ein Konflikt sollte sofort gelöst werden • Nach Lösung des Konflikts ausreichend testen • NIE einen Konflikt einfach mit den eigenen Änderungen überschreiben Einstieg SVN – ©2011 Michael van Engelshoven
  • 25. ko mm u n i k ati o n & s ys te m e Änderungen verwerfen Rennie $ svn revert README Reverted 'README' Rennie $ svn update README At revision 13. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 26. ko mm u n i k ati o n & s ys te m e Konfliktete Datei Einstieg SVN – ©2011 Michael van Engelshoven
  • 27. ko mm u n i k ati o n & s ys te m e Mir Egal! Rennie $ cp README.mine README Rennie $ svn resolved README Resolved conflicted state of 'README' Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 28. ko mm u n i k ati o n & s ys te m e Zusammenführen 1. Konfliktete Datei enthält Marker 2. Änderungen aus .mine und .r123 abgleichen 3. Mit anderem Entwickler zusammen setzen 4. Marker entfernen 5. Datei als resolved markieren Einstieg SVN – ©2011 Michael van Engelshoven
  • 29. ko mm u n i k ati o n & s ys te m e So kann das aussehen … 12 <<<<<<< .mine 13 This is fun stuff! 14 ======= 15 This is a documentation file 16 >>>>>>> .r13 Einstieg SVN – ©2011 Michael van Engelshoven
  • 30. ko mm u n i k ati o n & s ys te m e Zeit zu mergen Einstieg SVN – ©2011 Michael van Engelshoven
  • 31. ko mm u n i k ati o n & s ys te m e Zeit zu mergen • Täglich: Um Branch aktuell zu halten • Am Ende der Entwicklung: Um Änderungen in den Trunk zu bringen • Ggf. um gezielte Änderungen zu übernehmen Einstieg SVN – ©2011 Michael van Engelshoven
  • 32. ko mm u n i k ati o n & s ys te m e Vorgehensweise „Merge“ 1. Es sind keine lokalen Änderungen mehr vorhanden 2. Mit Arbeitskopie in Zielzweig switchen 3. Merge aus Quellzweig in lokale Arbeitskopie 4. Testen! 5. Commit der geänderten Dateien Einstieg SVN – ©2011 Michael van Engelshoven
  • 33. ko mm u n i k ati o n & s ys te m e Keep up to date! Rennie $ svn merge http://svnrepo/rennie/trunk --- Merging r5 through r18 into '.': A neueDatei.php U index.html Rennie $ svn commit . -m „Aktuellen Stand aus trunk gemerged“ A neueDatei.php U index.html Committed revision 19. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 34. ko mm u n i k ati o n & s ys te m e Branch reintegrieren Rennie $ svn switch http://svnrepo/rennie/trunk D neueDatei.php U index.html Updated to revision 18. Rennie $ svn merge --reintegrate http://svnrepo/rennie/branches/Umbau --- Merging r5 through r18 into '.': A neueDatei.php U index.html Rennie $ svn commit . -m „Umbau-Branch zurück gemerged“ ... Committed revision 19. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 35. ko mm u n i k ati o n & s ys te m e Visualisierung eines Projektes /branches/blubb 6 10 12 /branches/foo /branches/bar 2 3 7 9 1 4 8 11 13 15 /trunk 5 14 /tags/Version-1.0 /tags/Version-1.1 Einstieg SVN – ©2011 Michael van Engelshoven
  • 36. ko mm u n i k ati o n & s ys te m e Projekt exportieren Einstieg SVN – ©2011 Michael van Engelshoven
  • 37. ko mm u n i k ati o n & s ys te m e Tag erstellen $ svn copy -m „Tag für Livedeploy erstellt. Ticket: SOD-123“ http://svnrepo/rennie/trunk http://svnrepo/rennie/tags/Version-1.1 Committed revision 20. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 38. ko mm u n i k ati o n & s ys te m e Tag exportieren Rennie $ svn export http://svnrepo/rennie/tags/Version-1.0 ~/Desktop/Rennie-1.0 A index.html A neueDatei.php Exported revision 19. Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 39. ko mm u n i k ati o n & s ys te m e Diff zwischen Zweigen Rennie $ svn diff http://svnrepo/rennie/tags/Version-1.0 http://svnrepo/rennie/tags/Version-1.1 --summarize M branches/Umbau/index.html D branches/Umbau/.DS_Store M branches/Umbau/ A branches/Umbau/auth/login.php Rennie $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 40. ko mm u n i k ati o n & s ys te m e Checkout auf Live Live $ svn checkout https://trac.bainbits.net/ ... /tags/Version-1.1 customized A customized/index.html A customized/.DS_Store A customized/irgendwas.php A customized/auth/login.php Checked out revision 20. Live $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 41. ko mm u n i k ati o n & s ys te m e Live updaten Live $ svn switch ^/tags/Version-1.2 customized M customized/index.html D customized/.DS_Store M customized/ A customized/auth/logout.php Checked out revision 149. Live $ Einstieg SVN – ©2011 Michael van Engelshoven
  • 42. ko mm u n i k ati o n & s ys te m e Tags für Live-Checkouts • Bietet uns eine enorme Stabilität • Erleichter uns den Schritt zurück zum vorherigen Stand • Dient als Dokumentation Einstieg SVN – ©2011 Michael van Engelshoven
  • 43. ko mm u n i k ati o n & s ys te m e P.S. Commits von Live nicht als Brainbits Benutzer! Live $ svn commit --username mvanengelshoven . -m „So ists richtig“ Einstieg SVN – ©2011 Michael van Engelshoven
  • 44. ko mm u n i k ati o n & s ys te m e Viel Spass! Einstieg SVN – ©2011 Michael van Engelshoven
  • 45. ko mm u n i k ati o n & s ys te m e Quellen • Ariejan – How to resolve Subversion Conflicts http://ariejan.net/2007/07/04/how-to-resolve-subversion-conflicts/ • Wikipedia – Apache Subversion http://de.wikipedia.org/wiki/Apache_Subversion • Apache SVN – Subversion best practices http://svn.apache.org/repos/asf/subversion/trunk/doc/user/svn-best-practices.html Einstieg SVN – ©2011 Michael van Engelshoven