• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Why You Should Be Using Git
 

Why You Should Be Using Git

on

  • 469 views

 

Statistics

Views

Total Views
469
Views on SlideShare
469
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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.

Why You Should Be Using Git Why You Should Be Using Git Presentation Transcript

  • 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● Merge● Pull – Download changes from remote repo (svn update)● Push – Upload changes to remote repo (svn does this on each commit)
  • git is...DISTRIBUTED
  • Centralized
  • Distributed Backups Offline operations Fast Multiple workflows possible
  • 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 feature git branch feature
  • Branching master1 2 3 4 feature HEAD git checkout feature
  • Branching master1 2 3 4 5 feature HEAD git commit
  • Branching HEAD master1 2 3 4 5 feature git checkout master
  • Branching HEAD master 61 2 3 4 5 feature git commit
  • Branching HEAD master 6 71 2 3 4 5 feature git merge feature
  • Branching HEAD master 6 71 2 3 4 5 git branch -d feature
  • Tagging HEAD master1 2 3 4
  • Tagging HEAD master1 2 3 4 v0.1 git tag v0.1
  • Tagging HEAD master 6 71 2 3 4 5 v0.1
  • Tagging master 6 71 2 3 4 5 v0.1 HEAD git checkout v0.1
  • 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 feature1 git branch feature1
  • Git flow master dev... 3 4 5 v0.1 feature1
  • Git flow master dev... 3 4 5 v0.1 6 feature1 git commit
  • Git flow master dev... 3 4 5 v0.1 6 7 feature1 git commit
  • Git flow master dev... 3 4 5 8 v0.1 6 7 feature1 git commit
  • Git flow master dev... 3 4 5 8 v0.1 6 7 9 feature1 git commit
  • Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 feature1 git merge feature1
  • Git flow master dev... 3 4 5 8 10 v0.1 6 7 9 git branch -d feature1
  • Git flow master... 3 4 5 8 10 dev v0.1 6 7 9
  • Git flow master release-v1.0... 3 4 5 8 10 dev v0.1 6 7 9 git branch release-v1.0
  • Git flow release-v1.0 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
  • Git flow release-v1.0 12 11 master... 3 4 5 8 10 dev v0.1 6 7 9 git commit
  • Git flow release-v1.0 12 11 master... 3 4 5 8 10 13 v0.1 dev 6 7 9 git commit
  • 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
  • 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
  • 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
  • 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
  • Git flow master dev 14 12 15 v1.0 11... 3 4 5 8 10 13 v0.1 6 7 9
  • Git flow master dev... 3 14 15 12 v0.1 v1.0 ...
  • Git flow master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • Git flow master hotfix dev... 3 14 15 16 12 v0.1 v1.0 ... git branch hotfix
  • Git flow 17 hotfix master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • Git flow 18 hotfix 17 master dev... 3 14 15 16 12 v0.1 v1.0 ... git commit
  • Git flow master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
  • Git flow v1.1 master 18 hotfix 17 dev... 3 14 15 16 12 v0.1 v1.0 ... git tag v1.1
  • Git flow v1.1 master 18 hotfix dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git merge hotfix
  • Git flow v1.1 master 18 dev 17 19... 3 14 15 16 12 v0.1 v1.0 ... git branch -d hotfix
  • Gitflow
  • Git flow at SAPO
  • Tópicos extra● Repositório local de backup.● Mudar de repositorio remoto.● Push para dois repositórios diferentes.● Corrigir o último commit.● Stashing.● Rebase.
  • Mergemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
  • Merge branch HEAD 2e71master 9ef8 e404 438b 0928 a4c6 git merge master
  • Rebasemaster 9ef8 e404 branch HEAD 438b 0928 a4c6
  • Rebase 13d4 branch HEADmaster 9ef8 a431 438b a4c6 git rebase master
  • 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
  • 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/