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

Gitflow Fixed

Yudhi Satrio
February 09, 2017

Gitflow Fixed

Yudhi Satrio

February 09, 2017
Tweet

More Decks by Yudhi Satrio

Other Decks in Programming

Transcript

  1. An ordinary Front End Developer who like share knowledge. "I'm

    not smarter than you, I'm just know first than you. If you find something wrong, please tell me and we will fix it together."
  2. Asumption Repo is abbreviation of Repository Pull is a command

    to get latest version of code Push is a command to post our latest version of code Branch is our own develop environment based on feature or whatever we will doing Commit is a command to tell git that we have done with our own feature Merge is a command to merge our work to whatever branch we want I use terminal only not using GUI
  3. Collaboration Developer have Back end, Front end, and whatever job

    title out there. Every parts of job needs to organize well. By manual, we will copy our work files to another team Also syncronize it or just rewrite the file on local If we have different code, we need to analyze it first before rewrite.
  4. Version Control Version control is the management of changes to

    documents, computer programs, large web sites, and other collections of information. Some of Version Control software: SVN (Subversion) Mercurial Git
  5. Git Git is a version control system (VCS) software for

    tracking changes in computer files and coordinating work on those files among multiple people. With git, every person in project have their own copy files at their local. Some example of Git Providers are Github, Bitbucket, Gitlab, VSTS
  6. Example Putri publish her featuer on master, but she has

    a problem. Her feature was conflicts with Jono's feature. Bejo want to be a hero, he help Putri to fix the conflicts.
  7. Example Bejo help Putri to pull the latest version of

    master and rebase local version for her.
  8. Example Rebase succeed, Putri can publish her feature on master

    cause of Bejo. And then Putri hate Jono forever. Finally Bejo and Putri live happily ever after.
  9. Feature Branch Feature branch is a more safer and minimum

    conflicts instead Centralized. Every person have their own branch to do the feature. You can see below, Blue one is a master, the purple and green is a branch.
  10. Example Putri finish her feature and publish it on master

    and create pull request to tell the team that she has done with her feature.
  11. Gitflow Gitflow workflow derived from Vincent Driessen at nvie. You

    can download gitflow here https://github.com/nvie/gitflow.
  12. Gitflow Branch master is primary repo for production only hotfixes

    is for fix feature that have realeased on master realease is for realease a finish feature from develop develop is a secondary repo for development stage, it will be deploy in staging feature is a branch to do feature from backlog
  13. Gitflow manually Since Gitflow have 2 branches we need to

    create one more called develop g i t c h e c k o u t ­ b d e v e l o p m a s t e r Explaination, we move to develop branch with command "checkout". "­b" is an option to create a new branch if the branch not exist. In a fourth section "develop" is a name of branch we want to create. The last, "master" is base of branch we want to clone to our branch.
  14. Gitflow Feature If we want to works on our feature

    we need to tell git to create once more branch. Called "feature/feature­name". and when if we finish, we merge on develop branch. You can follow command below / / c r e a t e n e w b r a n c h g i t c h e c k o u t ­ b f e a t u r e / f e a t u r e ­ n a m e d e v e l o p / / m e r g e f e a t u r e d o n e g i t c h e c k o u t d e v e l o p g i t m e r g e f e a t u r e / f e a t u r e ­ n a m e g i t b r a n c h ­ d f e a t u r e / f e a t u r e ­ n a m e
  15. Gitflow Release When the feature finish and no bugs on

    develop stage, then we release feature to master. you can see below / / c r e a t e n e w b r a n c h g i t c h e c k o u t ­ b r e l e a s e / r e l e a s e ­ n a m e d e v e l o p / / m e r g e r e l e a s e d o n e g i t c h e c k o u t m a s t e r g i t m e r g e r e l e a s e / r e l e a s e ­ n a m e g i t c h e c k o u t d e v e l o p g i t m e r g e r e l e a s e / r e l e a s e ­ n a m e g i t b r a n c h ­ d r e l e a s e / r e l e a s e ­ n a m e
  16. Gitflow Hotfixes Hotfixes is very similar with release but it

    clone from master. / / c r e a t e n e w b r a n c h g i t c h e c k o u t ­ b h o t f i x / h o t f i x ­ n a m e m a s t e r / / m e r g e h o t f i x d o n e g i t c h e c k o u t m a s t e r g i t m e r g e h o t f i x / h o t f i x ­ n a m e g i t c h e c k o u t d e v e l o p g i t m e r g e h o t f i x / h o t f i x ­ n a m e g i t b r a n c h ­ d h o t f i x / h o t f i x ­ n a m e
  17. Gitflow itself There are the illustration of gitflow by manual.

    Fortunately, Gitflow have a plugin for to make our life easier. I will attach the command below. If you first clone from repo, you should run init, "­d" is to make gitflow use default option, if not include "­d" you will prompted to write what is your default name of gitflow. g i t f l o w i n i t [ ­ d ] g i t f l o w f e a t u r e g i t f l o w f e a t u r e s t a r t < n a m e > [ < b a s e > ] g i t f l o w f e a t u r e f i n i s h < n a m e > g i t f l o w r e l e a s e g i t f l o w r e l e a s e s t a r t < r e l e a s e > [ < b a s e > ] g i t f l o w r e l e a s e f i n i s h < r e l e a s e > g i t f l o w h o t f i x g i t f l o w h o t f i x s t a r t < r e l e a s e > [ < b a s e > ] g i t f l o w h o t f i x f i n i s h < r e l e a s e >
  18. Resources Change issue tracker bitbucket using Kanban style Bucket Board

    Gitflow https://github.com/nvie/gitflow Compare workflow https://www.atlassian.com/git/tutorials/comparing­workflows Oh Sh*t git shitgit.com