Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GIT Versioning - From Padawans to Jedis

GIT Versioning - From Padawans to Jedis

An overview about GIT version control and an introduction of how to use it correctly, presented at PUC Padawan's MeetUp group.

Lucas Mendes

May 16, 2016
Tweet

More Decks by Lucas Mendes

Other Decks in Technology

Transcript

  1. GIT VERSIONING - FROM PADAWANS TO JEDIS VCS - VERSION

    CONTROL SYSTEM Revision Control, also know as version control and source control, it’s a software to manage different versions in the development of any document. This systems are generally used in the development of softwares to control the version during the software lifetime and keep a history of the modifications made by the development team.
  2. GIT VERSIONING - FROM PADAWANS TO JEDIS VCS - VERSION

    CONTROL SYSTEM - SOME OF THEM ▸ Concurrent Versions System (CVS) ▸ Subversion (SVN) ▸ GIT ▸ BitKeeper ▸ Mercurial ▸ 100’s of others…
  3. GIT

  4. GIT VERSIONING - FROM PADAWANS TO JEDIS WHY GIT? ▸

    Free and Open Source ▸ Simple usage ▸ Small and Fast ▸ Decentralised and distributed ▸ Excellent branching and merging models ▸ Data Assurance
  5. GIT VERSIONING - FROM PADAWANS TO JEDIS WHY GIT? ▸

    Designed for little and big projects ▸ Strong Support for non-linear development ▸ GUI Tools
  6. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FOR PADAWANS

    - INSTALLING GIT ▸ Fedora based: sudo yum install git-all ▸ Debian based: sudo apt-get install git-all ▸ OSX: XCode Tools ▸ Windows: Binary package ▸ From Source: PLAY HARD!
  7. GIT VERSIONING - FROM PADAWANS TO JEDIS BRANCHES A branch

    in a GIT repository it’s a ramification starting from an origin branch, where you can do changes without elsewhere in the development flow.
  8. LOG

  9. GIT VERSIONING - FROM PADAWANS TO JEDIS ADVANCED BRANCHING -

    MERGE AND REBASE Merge and Rebase are actions performed in GIT repositories to join updates made in a separated branch into another branch.
  10. GIT VERSIONING - FROM PADAWANS TO JEDIS ADVANCED BRANCHING -

    MERGE VS REBASE ▸ Merge: Applies a update block in a destination branch, generating a merge-commit on the top of the development history of that branch. ▸ Rebase: Reapply commits on top of another branch without generate merge-commits.
  11. GIT VERSIONING - FROM PADAWANS TO JEDIS ADVANCED BRANCHING -

    MERGE ▸ Pros: ▸ Traceability ▸ More secure ▸ Cons: ▸ Dirty development history
  12. GIT VERSIONING - FROM PADAWANS TO JEDIS ADVANCED BRANCHING -

    REBASE ▸ Pros: ▸ Clean development history ▸ Handle just one commit is quite easy ▸ Useful in patches
  13. GIT VERSIONING - FROM PADAWANS TO JEDIS ADVANCED BRANCHING -

    REBASE ▸ Cons: ▸ Dangerous ▸ Don’t recommended to use in pull requests ▸ More work ▸ More conflicts
  14. GIT VERSIONING - FROM PADAWANS TO JEDIS VERSIONING YOUR PROJECT

    - SEMANTIC VERSIONING 2.10.6 MAJOR MINOR PATCH
  15. GIT VERSIONING - FROM PADAWANS TO JEDIS VERSIONING YOUR PROJECT

    - SEMANTIC VERSIONING ▸ Increment: ▸ MAJOR: When you make incompatible API changes ▸ MINOR: When you add functionality in backwards- compatible manner ▸ PATCH: When you make backwards-compatible bug fixes
  16. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FLOW -

    REMOTE REPOSITORY MODELLING An organised remote repository generally include two branches: develop and master. In the first (develop), we centralise the development history of the software. In the second (master), we have an stable history of our system
  17. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FLOW -

    FEATURE DEVELOPMENT ▸ Define a feature ▸ Ramified from the development branch ▸ Just one developer or team by feature ▸ Allows Continuous Integration ▸ Must be deleted after finished
  18. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FLOW -

    RELEASE FOR PRODUCTION ▸ Ramified from development branch ▸ Release hardening ▸ Minor version increases ▸ Updated the software document and support files
  19. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FLOW -

    RELEASE FOR PRODUCTION ▸ Merge ▸ Tag ▸ Package ▸ Release
  20. GIT VERSIONING - FROM PADAWANS TO JEDIS GIT FLOW -

    PERFORM A HOTFIX ▸ Ramified from the master branch ▸ Fix ▸ Test ▸ Increase patch version ▸ Merge ▸ Publish
  21. GIT VERSIONING - FROM PADAWANS TO JEDIS HOOKS - COMMITTING-WORKFLOW

    HOOKS ▸ pre-commit: used to inspect the current snapshot that’s about to be committed ▸ prepare-commit-msg: used to set a default commit message before the editor is fired up ▸ commit-msg: used to validate the commit message or any other thing before allowing a commit to go through ▸ post-commit: used to perform something after the commit completes, generally used for notification or something similar.
  22. GIT VERSIONING - FROM PADAWANS TO JEDIS HOOKS - SERVER

    SIDE HOOKS ▸ pre-receive: it’s fired when the remote receives the push request and it takes a list of references that are being pushed from stdin. ▸ update: it’s fired for each branch the pusher is trying to update, like the pre-receive, but one for each branch. ▸ post-receive: fired after the push is complete, generally used for notification or something similar.
  23. GIT VERSIONING - FROM PADAWANS TO JEDIS THANK YOU !

    Lucas Mendes Lead Engineer at @isetbr
 Head of Product at @2X3 [email protected]
 devsdmf.io
 github.com/devsdmf
 about.me/devsdmf
 twitter.com/devsdmf Slides: bit.ly/devsdmf-puc-pad