Your SlideShare is downloading. ×
0
Why you should be using       with very high probability...                                       Francisco Vieira
What is git?●   VCS●   Open source●   Distributed●   Offline●   Fast●   Flexible●   Complex●   Not SVN
Command Glossary●   Init – Create a repository●   Clone – Clone a repository (svn checkout)●   Commit – Offline commit●   ...
git is...DISTRIBUTED
Centralized
Distributed              Backups              Offline              operations              Fast              Multiple     ...
Distributed Workflows      Centralized
Distributed Workflows      Github-like          git init
Distributed Workflows      Github-like         git clone
Distributed Workflows      Github-like         git commit
Distributed Workflows      Github-like         git push
Distributed Workflows      Github-like         git clone
Distributed Workflows      Github-like         git clone
Distributed Workflows      Github-like         git commit
Distributed Workflows      Github-like         git push
Distributed Workflows      Github-like        Pull Request
Distributed Workflows      Github-like          git pull
Distributed Workflows      Github-like         git push
Distributed Workflows      Github-like
git has...A STAGING AREA
Staging Area
Staging Area
Staging Area – Example
Staging Area – Example
git has...EASY BRANCHING
Branching2fbc...      3fab...   b99d...
Branching1       2       3
Branching                master1       2         3
Branching                HEAD                master1       2         3
Branching                          HEAD                          master1    2                3     4         git commit
Branching                              HEAD                              master1    2                   3      4          ...
Branching                            master1    2                3       4                            feature             ...
Branching                       master1   2        3           4        5                                feature          ...
Branching                               HEAD                               master1   2           3                4       ...
Branching                       HEAD                       master                         61   2        3           4     ...
Branching                                 HEAD                                 master                             6     71...
Branching                                     HEAD                                     master                             ...
Tagging              HEAD              master1   2     3     4
Tagging                           HEAD                           master1   2                  3     4                     ...
Tagging                         HEAD                         master                   6       71   2      3       4       ...
Tagging                                   master                             6       71   2         3              4      ...
but...WHY BRANCHING?!
Typical Release Cycle
Typical Release Cycle
Gitflow
Git flow   git init
Git flowmaster  1           git commit
Git flow    master1     2               git commit
Git flow           master1   2        3          git commit
Git flow          master1   2        3           v0.1         git tag v0.1
Git flow            master1   2         3           dev             v0.1         git branch dev
Git flow           master      dev1   2        3         4            v0.1          git commit
Git flow           master          dev1   2        3         4   5            v0.1          git commit
Git flow             master                 dev1   2          3              4      5              v0.1                fea...
Git flow      master           dev...     3      4        5       v0.1          feature1
Git flow      master            dev...     3      4         5       v0.1                         6                      fe...
Git flow      master            dev...     3      4         5       v0.1                         6           7            ...
Git flow      master                        dev...     3      4         5           8       v0.1                         6...
Git flow      master                      dev...     3      4         5        8       v0.1                         6     ...
Git flow      master                                  dev...     3      4           5            8     10       v0.1      ...
Git flow      master                                    dev...     3      4             5              8   10       v0.1  ...
Git flow      master...     3      4       5      8   10   dev       v0.1                       6      7   9
Git flow      master                                     release-v1.0...     3      4             5               8       ...
Git flow                                      release-v1.0                                          11      master...     ...
Git flow                                      release-v1.0                                          12                    ...
Git flow                                      release-v1.0                                          12                    ...
Git flow                                     master    release-v1.0                                          14       12  ...
Git flow                                 master   release-v1.0                                  14          12            ...
Git flow                                     master    release-v1.0   dev                                          14     ...
Git flow                                    master        dev                                      14     12   15         ...
Git flow                            master        dev                             14      12   15                         ...
Git flow             master        dev...    3      14           15                      12      v0.1    v1.0             ...
Git flow             master                    dev...    3      14                  15   16                             12...
Git flow             master          hotfix             dev...    3               14                  15   16             ...
Git flow                       17         hotfix             master                             dev...    3               ...
Git flow                       18         hotfix                       17             master                             d...
Git flow             master     18         hotfix                        17                                               ...
Git flow                       v1.1             master    18          hotfix                       17                     ...
Git flow                       v1.1             master     18         hotfix                                              ...
Git flow                        v1.1             master     18                                                  dev       ...
Gitflow
Git flow at SAPO
Tópicos extra●   Repositório local de backup.●   Mudar de repositorio remoto.●   Push para dois repositórios diferentes.● ...
Mergemaster   9ef8           e404   branch   HEAD         438b           0928                 a4c6
Merge                    branch         HEAD                    2e71master   9ef8                  e404         438b      ...
Rebasemaster   9ef8            e404   branch   HEAD         438b            0928                  a4c6
Rebase                       13d4         branch   HEADmaster   9ef8          a431         438b                    a4c6   ...
GUI Clients●   git-gui (for commiting) and gitk (for browsing)●   Github Client (Windows and Osx)●   SourceTree (Osx)●   T...
References●   Git flow - http://nvie.com/posts/a-successful-git-branching-model/●   Pro git book - http://git-scm.com/book...
Why You Should Be Using Git
Why You Should Be Using Git
Why You Should Be Using Git
Why You Should Be Using Git
Upcoming SlideShare
Loading in...5
×

Why You Should Be Using Git

340

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
340
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Disable “Take a Break”!!!
  • - Not something you are going to fully understand in an hour - Don’t try to map your understanding of subversion onto git
  • - No need for a connection anywhere - (Online) Push and pull - John testa o software em vários sistemas operativos
  • Setas não representam direcção do tempo. Explicar SHA1 (20 bytes, 40 char)
  • Git finds merge ancestor automatically Conflict resolution
  • Atenção à direcção das setas. Porque feature branches: - se os requisitos mudam e uma feature passa a ser desnessesária, o código relativo à feature vai para o lixo. Então e as outras alterações feitas a meio da criação da feature (bug-fixes, pequenas refactorizações)?
  • Hea
  • HEAD desnecessária. É onde ocorre a acção (commit, merge, tag).
  • Branch dev: - Código que vai estar com certeza na próxima release.
  • Vantagens de ter features em branches: - Permite ao developer trabalhar na feature sem ter que se preocupar muito com o resto do desenvolvimento. - Permite visualizar facilmente todas as modificações que são efectuadas por aquela feature. - Fácil de discartar ideias - Fácil de adiar o lançamento de uma feature para outra release
  • Só bugfixes no branch release. No dev podemos começar a preparar a próxima release. Este é talvez a altura certa para lançar uma versão beta.
  • Integrar os bugfixes desta release no desenvolvimento da próxima.
  • É descoberto um bug em produção que tem que ser resolvido imediatamente! Resolvê-lo no branch dev não serve, há lá alterações que não estão prontas para produção!
  • Se o hotfix está terminado, qual o próximo passo? merge
  • Fast-forward Não há commit de merge.
  • Atenção à direcção das setas. Porque feature branches: - se os requisitos mudam e uma feature passa a ser desnessesária, o código relativo à feature vai para o lixo. Então e as outras alterações feitas a meio da criação da feature (bug-fixes, pequenas refactorizações)?
  • - Sublime - check_ssl para intra - Intra e github - Commit ammending
  • SHA mudou Só usar se não tiver sido publicado.
  • Transcript of "Why You Should Be Using Git"

    1. 1. Why you should be using with very high probability... Francisco Vieira
    2. 2. What is git?● VCS● Open source● Distributed● Offline● Fast● Flexible● Complex● Not SVN
    3. 3. Command Glossary● Init – Create a repository● Clone – Clone a repository (svn checkout)● Commit – Offline commit● Merge● Pull – Download changes from remote repo (svn update)● Push – Upload changes to remote repo (svn does this on each commit)
    4. 4. git is...DISTRIBUTED
    5. 5. Centralized
    6. 6. Distributed Backups Offline operations Fast Multiple workflows possible
    7. 7. Distributed Workflows Centralized
    8. 8. Distributed Workflows Github-like git init
    9. 9. Distributed Workflows Github-like git clone
    10. 10. Distributed Workflows Github-like git commit
    11. 11. Distributed Workflows Github-like git push
    12. 12. Distributed Workflows Github-like git clone
    13. 13. Distributed Workflows Github-like git clone
    14. 14. Distributed Workflows Github-like git commit
    15. 15. Distributed Workflows Github-like git push
    16. 16. Distributed Workflows Github-like Pull Request
    17. 17. Distributed Workflows Github-like git pull
    18. 18. Distributed Workflows Github-like git push
    19. 19. Distributed Workflows Github-like
    20. 20. git has...A STAGING AREA
    21. 21. Staging Area
    22. 22. Staging Area
    23. 23. Staging Area – Example
    24. 24. Staging Area – Example
    25. 25. git has...EASY BRANCHING
    26. 26. Branching2fbc... 3fab... b99d...
    27. 27. Branching1 2 3
    28. 28. Branching master1 2 3
    29. 29. Branching HEAD master1 2 3
    30. 30. Branching HEAD master1 2 3 4 git commit
    31. 31. Branching HEAD master1 2 3 4 feature git branch feature
    32. 32. Branching master1 2 3 4 feature HEAD git checkout feature
    33. 33. Branching master1 2 3 4 5 feature HEAD git commit
    34. 34. Branching HEAD master1 2 3 4 5 feature git checkout master
    35. 35. Branching HEAD master 61 2 3 4 5 feature git commit
    36. 36. Branching HEAD master 6 71 2 3 4 5 feature git merge feature
    37. 37. Branching HEAD master 6 71 2 3 4 5 git branch -d feature
    38. 38. Tagging HEAD master1 2 3 4
    39. 39. Tagging HEAD master1 2 3 4 v0.1 git tag v0.1
    40. 40. Tagging HEAD master 6 71 2 3 4 5 v0.1
    41. 41. Tagging master 6 71 2 3 4 5 v0.1 HEAD git checkout v0.1
    42. 42. but...WHY BRANCHING?!
    43. 43. Typical Release Cycle
    44. 44. Typical Release Cycle
    45. 45. Gitflow
    46. 46. Git flow git init
    47. 47. Git flowmaster 1 git commit
    48. 48. Git flow master1 2 git commit
    49. 49. Git flow master1 2 3 git commit
    50. 50. Git flow master1 2 3 v0.1 git tag v0.1
    51. 51. Git flow master1 2 3 dev v0.1 git branch dev
    52. 52. Git flow master dev1 2 3 4 v0.1 git commit
    53. 53. Git flow master dev1 2 3 4 5 v0.1 git commit
    54. 54. Git flow master dev1 2 3 4 5 v0.1 feature1 git branch feature1
    55. 55. Git flow master dev... 3 4 5 v0.1 feature1
    56. 56. Git flow master dev... 3 4 5 v0.1 6 feature1 git commit
    57. 57. Git flow master dev... 3 4 5 v0.1 6 7 feature1 git commit
    58. 58. Git flow master dev... 3 4 5 8 v0.1 6 7 feature1 git commit
    59. 59. Git flow master dev... 3 4 5 8 v0.1 6 7 9 feature1 git commit
    60. 60. Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 feature1 git merge feature1
    61. 61. Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 git branch -d feature1
    62. 62. Git flow master... 3 4 5 8 10 dev v0.1 6 7 9
    63. 63. Git flow master release-v1.0... 3 4 5 8 10 dev v0.1 6 7 9 git branch release-v1.0
    64. 64. Git flow release-v1.0 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
    65. 65. Git flow release-v1.0 12 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
    66. 66. Git flow release-v1.0 12 11 master... 3 4 5 8 10 13 v0.1 dev 6 7 9 git commit
    67. 67. Git flow master release-v1.0 14 12 11... 3 4 5 8 10 13 v0.1 dev 6 7 9 git merge release-v1.0
    68. 68. Git flow master release-v1.0 14 12 v1.0 11... 3 4 5 8 10 13 v0.1 dev 6 7 9 git tag v1.0
    69. 69. Git flow master release-v1.0 dev 14 12 15 v1.0 11... 3 4 5 8 10 13 v0.1 6 7 9 git merge release-v1.0
    70. 70. Git flow master dev 14 12 15 v1.0 11... 3 4 5 8 10 13 v0.1 6 7 9 git branch -d release-v1.0
    71. 71. Git flow master dev 14 12 15 v1.0 11... 3 4 5 8 10 13 v0.1 6 7 9
    72. 72. Git flow master dev... 3 14 15 12 v0.1 v1.0 ...
    73. 73. Git flow master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
    74. 74. Git flow master hotfix dev... 3 14 15 16 12 v0.1 v1.0 ... git branch hotfix
    75. 75. Git flow 17 hotfix master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
    76. 76. Git flow 18 hotfix 17 master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
    77. 77. Git flow master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
    78. 78. Git flow v1.1 master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git tag v1.1
    79. 79. Git flow v1.1 master 18 hotfix dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
    80. 80. Git flow v1.1 master 18 dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git branch -d hotfix
    81. 81. Gitflow
    82. 82. Git flow at SAPO
    83. 83. Tópicos extra● Repositório local de backup.● Mudar de repositorio remoto.● Push para dois repositórios diferentes.● Corrigir o último commit.● Stashing.● Rebase.
    84. 84. Mergemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
    85. 85. Merge branch HEAD 2e71master 9ef8 e404 438b 0928 a4c6 git merge master
    86. 86. Rebasemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
    87. 87. Rebase 13d4 branch HEADmaster 9ef8 a431 438b a4c6 git rebase master
    88. 88. GUI Clients● git-gui (for commiting) and gitk (for browsing)● Github Client (Windows and Osx)● SourceTree (Osx)● TortoiseGit (Windows)● Gitg (Gnome)● See more here: http://git-scm.com/downloads/guis
    89. 89. References● Git flow - http://nvie.com/posts/a-successful-git-branching-model/● Pro git book - http://git-scm.com/book● Git tutorial - http://gitimmersion.com/● Cheat sheet - http://media.developerforce.com/cheatsheets/SF_GIT_2Pg_HR_V10.pdf● Visual cheatsheet - http://ndpsoftware.com/git-cheatsheet.html● GitHub - https://github.com/● Heroku - http://www.heroku.com/
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×