Share
Embed
Gitflow Fixed
Yudhi Satrio
February 09, 2017
Transcript
27 slides
-
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." -
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 -
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. -
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 -
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 -
Centralized Centralized just have one branch, "Master". Everytime create a
feature, we just create it at master branch. -
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. -
Example Bejo help Putri to pull the latest version of
master and rebase local version for her. -
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. -
Managing Conficts This is a diagram of managing conflicts from
Jono and Putri in example above. -
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. -
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. -
Example Jono recieve the pull request from putri and merge
on his feature -
Gitflow Gitflow workflow derived from Vincent Driessen at nvie. You
can download gitflow here https://github.com/nvie/gitflow. -
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 -
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. -
Gitflow Feature If we want to works on our feature
we need to tell git to create once more branch. Called "feature/featurename". 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 -
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 -
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 -
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 > -
Resources Change issue tracker bitbucket using Kanban style Bucket Board
Gitflow https://github.com/nvie/gitflow Compare workflow https://www.atlassian.com/git/tutorials/comparingworkflows Oh Sh*t git shitgit.com