SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Git für Fortgeschrittene



         David Soria Parra I 31. May 2010 | @dsp_




                                                    © 2010 Mayflower GmbH

Montag, 31. Mai 2010
Erwartungen



          I    Man hat Git benutzt
          I    Man kann committen
          I    Branch, Push, Pull, Checkout




                                              Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Motivation



          I    Viele migrieren: Zend Framework, phpBB, PHPUnit, ...
          I    Größere Projekte haben komplexe Anwendungsfälle
          I    Wir sind am Anfang des Technology Life Cycle




                                                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Beispiel

    developer




                                  Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Branch und Rebase




              Editieren       Commit                         Veröffentlichen




                                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Feature Branch
                        „Jedes Feature auf eine Branch“




                                                 Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
feature-x



                                                       master
                       DAG (Directed Acyclic Graph)




                                                      Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
master
                                                         feature-y
                       git checkout feature-y   git rebase master


                                                        Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Branch und Rebase




              Commit          Rebase                                 Merge




                                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Branch und Rebase




                                     bf0255ae




                                                                               feature-y
        git rebase -i bf0225ae   pick / rotate                    squash


                                                 Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
„Never rebase branches that you pulled or
                       pushed. Rebase local branches only!“




                                                   Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Index




                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
$ git status
                       # On branch master
                       # Changed but not updated:
                       # (use "git add <file>..." to update what will be committed)
                       # (use "git checkout -- <file>..." to discard changes in working directory)
                       #
                       #      modified: README.md
                       #
                       no changes added to commit (use "git add" and/or "git commit -a")

                       $ git commit
                       no changes added to commit (use "git add" and/or "git commit -a")




                                                                           Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
working directory            index                      repository


                            git add [file]

                           git stage [file]

                                                     git commit

                                      git commit -a




                                                           Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
static int run_builtin(struct cmd_st
                       +     int status, help;
                            struct stat st;
                            const char *prefix;

                            prefix = NULL;
                            help = argc == 2 && !strcmp(argv[1],
                            if (!help) {
                                  if (p->option & RUN_SETUP)
                                        prefix = setup_git_directory();

                       +          if (use_pager == -1 && p->option
                       +                use_pager = check_pager_c
                       +          if (use_pager == -1 && p->option
                       +
                            }
                                         use_pager = 1;
                                                                                                            Commit
                            commit_pager_choice();




                                                                         git add -i



                                                                                      Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Neue Konzepte
                       Neue Möglichkeiten



                                      Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Projekt




                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
externe Module




             submodules
                          Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
phpBB


                                                                git.zendframework.com
                       Zend Framework 2




                                           git init phpBB


                       git submodule add git://..../zf2.git Zend Framework 2

                                                                    Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
phpBB


                         Zend Framework 2                        git.zendframework.com


                         Symphony 2                              git.github.com




                       git clone            git submodule init           git submodule update



                                                                    Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Git ist kein Subversion




                                         Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
system integration




    Administratives
                                     Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Reflog




                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Reflog



          I    Das Tool zur Recovery


          I WICHTIG!




                                       Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
HEAD@{1}
                git checkout test   git checkout master                git branch -D test



                                                          Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Git ist manchmal
                       trickreich



                                          Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Zusammenfassung



          I    DAG und Rebase
          I    Index
          I    Submodule
          I    Reflog




                                Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Weiterführendes



          I    Konzepten
                I      Storage Format
                I      Refspecs
          I    Cooles Features
                I      Bisect
                I      Notes




                                        Git für Fortgeschrittene I   Mayflower GmbH I May 31, 2010 I

Montag, 31. Mai 2010
Vielen Dank für Ihre Aufmerksamkeit!




                            Fragen?


                                                 © 2010 Mayflower GmbH

Montag, 31. Mai 2010

Weitere ähnliche Inhalte

Mehr von Mayflower GmbH

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mayflower GmbH
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: SecurityMayflower GmbH
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftMayflower GmbH
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientMayflower GmbH
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingMayflower GmbH
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...Mayflower GmbH
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyMayflower GmbH
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming MythbustersMayflower GmbH
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im GlückMayflower GmbH
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefernMayflower GmbH
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsMayflower GmbH
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalierenMayflower GmbH
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastMayflower GmbH
 

Mehr von Mayflower GmbH (20)

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
 
Usability im web
Usability im webUsability im web
Usability im web
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
 

Git für Fortgeschrittene

  • 1. Git für Fortgeschrittene David Soria Parra I 31. May 2010 | @dsp_ © 2010 Mayflower GmbH Montag, 31. Mai 2010
  • 2. Erwartungen I Man hat Git benutzt I Man kann committen I Branch, Push, Pull, Checkout Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 3. Motivation I Viele migrieren: Zend Framework, phpBB, PHPUnit, ... I Größere Projekte haben komplexe Anwendungsfälle I Wir sind am Anfang des Technology Life Cycle Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 4. Beispiel developer Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 5. Branch und Rebase Editieren Commit Veröffentlichen Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 6. Feature Branch „Jedes Feature auf eine Branch“ Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 7. feature-x master DAG (Directed Acyclic Graph) Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 8. master feature-y git checkout feature-y git rebase master Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 9. Branch und Rebase Commit Rebase Merge Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 10. Branch und Rebase bf0255ae feature-y git rebase -i bf0225ae pick / rotate squash Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 11. „Never rebase branches that you pulled or pushed. Rebase local branches only!“ Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 12. Index Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 13. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: README.md # no changes added to commit (use "git add" and/or "git commit -a") $ git commit no changes added to commit (use "git add" and/or "git commit -a") Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 14. working directory index repository git add [file] git stage [file] git commit git commit -a Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 15. static int run_builtin(struct cmd_st + int status, help; struct stat st; const char *prefix; prefix = NULL; help = argc == 2 && !strcmp(argv[1], if (!help) { if (p->option & RUN_SETUP) prefix = setup_git_directory(); + if (use_pager == -1 && p->option + use_pager = check_pager_c + if (use_pager == -1 && p->option + } use_pager = 1; Commit commit_pager_choice(); git add -i Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 16. Neue Konzepte Neue Möglichkeiten Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 17. Projekt Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 18. externe Module submodules Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 19. phpBB git.zendframework.com Zend Framework 2 git init phpBB git submodule add git://..../zf2.git Zend Framework 2 Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 20. phpBB Zend Framework 2 git.zendframework.com Symphony 2 git.github.com git clone git submodule init git submodule update Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 21. Git ist kein Subversion Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 22. system integration Administratives Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 23. Reflog Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 24. Reflog I Das Tool zur Recovery I WICHTIG! Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 25. HEAD@{1} git checkout test git checkout master git branch -D test Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 26. Git ist manchmal trickreich Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 27. Zusammenfassung I DAG und Rebase I Index I Submodule I Reflog Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 28. Weiterführendes I Konzepten I Storage Format I Refspecs I Cooles Features I Bisect I Notes Git für Fortgeschrittene I Mayflower GmbH I May 31, 2010 I Montag, 31. Mai 2010
  • 29. Vielen Dank für Ihre Aufmerksamkeit! Fragen? © 2010 Mayflower GmbH Montag, 31. Mai 2010