Why You Should Be Using Git
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
540
On Slideshare
540
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

  • 1. Why you should be using with very high probability... Francisco Vieira
  • 2. What is git?● VCS● Open source● Distributed● Offline● Fast● Flexible● Complex● Not SVN
  • 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. git is...DISTRIBUTED
  • 5. Centralized
  • 6. Distributed Backups Offline operations Fast Multiple workflows possible
  • 7. Distributed Workflows Centralized
  • 8. Distributed Workflows Github-like git init
  • 9. Distributed Workflows Github-like git clone
  • 10. Distributed Workflows Github-like git commit
  • 11. Distributed Workflows Github-like git push
  • 12. Distributed Workflows Github-like git clone
  • 13. Distributed Workflows Github-like git clone
  • 14. Distributed Workflows Github-like git commit
  • 15. Distributed Workflows Github-like git push
  • 16. Distributed Workflows Github-like Pull Request
  • 17. Distributed Workflows Github-like git pull
  • 18. Distributed Workflows Github-like git push
  • 19. Distributed Workflows Github-like
  • 20. git has...A STAGING AREA
  • 21. Staging Area
  • 22. Staging Area
  • 23. Staging Area – Example
  • 24. Staging Area – Example
  • 25. git has...EASY BRANCHING
  • 26. Branching2fbc... 3fab... b99d...
  • 27. Branching1 2 3
  • 28. Branching master1 2 3
  • 29. Branching HEAD master1 2 3
  • 30. Branching HEAD master1 2 3 4 git commit
  • 31. Branching HEAD master1 2 3 4 feature git branch feature
  • 32. Branching master1 2 3 4 feature HEAD git checkout feature
  • 33. Branching master1 2 3 4 5 feature HEAD git commit
  • 34. Branching HEAD master1 2 3 4 5 feature git checkout master
  • 35. Branching HEAD master 61 2 3 4 5 feature git commit
  • 36. Branching HEAD master 6 71 2 3 4 5 feature git merge feature
  • 37. Branching HEAD master 6 71 2 3 4 5 git branch -d feature
  • 38. Tagging HEAD master1 2 3 4
  • 39. Tagging HEAD master1 2 3 4 v0.1 git tag v0.1
  • 40. Tagging HEAD master 6 71 2 3 4 5 v0.1
  • 41. Tagging master 6 71 2 3 4 5 v0.1 HEAD git checkout v0.1
  • 42. but...WHY BRANCHING?!
  • 43. Typical Release Cycle
  • 44. Typical Release Cycle
  • 45. Gitflow
  • 46. Git flow git init
  • 47. Git flowmaster 1 git commit
  • 48. Git flow master1 2 git commit
  • 49. Git flow master1 2 3 git commit
  • 50. Git flow master1 2 3 v0.1 git tag v0.1
  • 51. Git flow master1 2 3 dev v0.1 git branch dev
  • 52. Git flow master dev1 2 3 4 v0.1 git commit
  • 53. Git flow master dev1 2 3 4 5 v0.1 git commit
  • 54. Git flow master dev1 2 3 4 5 v0.1 feature1 git branch feature1
  • 55. Git flow master dev... 3 4 5 v0.1 feature1
  • 56. Git flow master dev... 3 4 5 v0.1 6 feature1 git commit
  • 57. Git flow master dev... 3 4 5 v0.1 6 7 feature1 git commit
  • 58. Git flow master dev... 3 4 5 8 v0.1 6 7 feature1 git commit
  • 59. Git flow master dev... 3 4 5 8 v0.1 6 7 9 feature1 git commit
  • 60. Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 feature1 git merge feature1
  • 61. Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 git branch -d feature1
  • 62. Git flow master... 3 4 5 8 10 dev v0.1 6 7 9
  • 63. Git flow master release-v1.0... 3 4 5 8 10 dev v0.1 6 7 9 git branch release-v1.0
  • 64. Git flow release-v1.0 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
  • 65. Git flow release-v1.0 12 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
  • 66. Git flow release-v1.0 12 11 master... 3 4 5 8 10 13 v0.1 dev 6 7 9 git commit
  • 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. 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. 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. 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. Git flow master dev 14 12 15 v1.0 11... 3 4 5 8 10 13 v0.1 6 7 9
  • 72. Git flow master dev... 3 14 15 12 v0.1 v1.0 ...
  • 73. Git flow master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • 74. Git flow master hotfix dev... 3 14 15 16 12 v0.1 v1.0 ... git branch hotfix
  • 75. Git flow 17 hotfix master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • 76. Git flow 18 hotfix 17 master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • 77. Git flow master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
  • 78. Git flow v1.1 master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git tag v1.1
  • 79. Git flow v1.1 master 18 hotfix dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
  • 80. Git flow v1.1 master 18 dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git branch -d hotfix
  • 81. Gitflow
  • 82. Git flow at SAPO
  • 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. Mergemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
  • 85. Merge branch HEAD 2e71master 9ef8 e404 438b 0928 a4c6 git merge master
  • 86. Rebasemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
  • 87. Rebase 13d4 branch HEADmaster 9ef8 a431 438b a4c6 git rebase master
  • 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. 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/