git-flow R3Labs
-
Upload
rauel-perez -
Category
Documents
-
view
152 -
download
1
Transcript of git-flow R3Labs
![Page 1: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/1.jpg)
git-flowCarrenzaLabs branching model and best
practices
![Page 2: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/2.jpg)
What is git-flow?git flow are a set of git extensions to provide high-level repository operations for Vincent Driessen’s branching model.
http://nvie.com/posts/a-successful-git-branching-model/
![Page 3: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/3.jpg)
Basic tips●Git flow provides excellent command line
help and output.Read it carefully to see what’s happening …
●Git flow is a merge based solution. It doesn’t rebase feature requests.
![Page 4: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/4.jpg)
Setup●You need a working git installation as a
prerequisite.●Git flow works on OSX, Linux and Windows.
●OSX:○brew install git-flow
●Linux:○apt-get install git-flow
![Page 5: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/5.jpg)
Getting Started●Start using git-flow by initializing it inside an
existing git repository○git flow init
●You’ll have to answer a few questions regarding the naming conventions for your branches.
●It’s recommended to use the default values.
![Page 6: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/6.jpg)
FeaturesFor example new task that you need to work on, and usually originated from a JIRA issue.
![Page 7: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/7.jpg)
Features●Develop new features for upcoming
releases.
●Typically exist in developers repos only.
![Page 8: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/8.jpg)
Start a new feature●Development of new features starting from
the “develop” branch.
●Start developing a new feature with:○git flow feature start <MYFEATURE>
●This action creates a new feature branch based on “develop” and switches to it.
![Page 9: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/9.jpg)
Finish up a feature●Finish the development of a feature. This
action performs the following:○git flow feature finish <MYFEATURE>
●Merged MYFEATURE into “develop”.●Removes the feature branch.●Switches back to “develop” branch.
![Page 10: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/10.jpg)
Publish a feature●Are you developing a feature in
collaboration?
●Publish a feature to the remote server so it can be used by other users.
○git flow feature publish <MYFEATURE>
![Page 11: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/11.jpg)
Getting a published feature●Get a feature published by another user.
○git flow feature pull origin <MYFEATURE>
●You can track a feature on origin by using○git flow feature track <MYFEATURE>
![Page 12: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/12.jpg)
ReleasesFinished work! Bump a new version!
![Page 13: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/13.jpg)
Make a release●Support preparation of a new production
release.
●Allow for minor bug fixes and preparing meta-data for a release.
![Page 14: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/14.jpg)
Start a release●To start a release, use the git flow release
command. It creates a release branch created from the “develop” branch.
○git flow release start <RELEASE>
![Page 15: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/15.jpg)
Publish a release●It’s wise to publish the release branch after
creating it to allow release commits by other developers.Do it similar to feature publishing with the command:
○git flow release publish <RELEASE>
![Page 16: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/16.jpg)
Finish up a release●Finish a release is one of the big steps in git
branching. It performs several actions:○git flow release finish <RELEASE>
●Merges the release branch back into master.●Tags the release with its name.●Back-merges the release into “develop”.●Removes the release branch.
![Page 17: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/17.jpg)
Commit your work●Commit your work after you finish the
release.○git commit origin --all○git push origin --tags
![Page 18: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/18.jpg)
HotfixesDoh! We’re doomed … We broke production.
Run for you live!
![Page 19: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/19.jpg)
Hotfixes●Hotfixes arise from the necessity to act
immediately upon an undesired state of a live production version.
●May be branched off from the corresponding tag on the master branch that marks the production version.
![Page 20: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/20.jpg)
Start a new hotfix●Development of new hotfixes starting from
the “master” branch.
●Start developing a new hotfix with:○git flow hotfix start <MYFEATURE>
●This action creates a new hotfix branch based on “master” and switches to it.
![Page 21: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/21.jpg)
Finish up a hotfix●Finish the development of a hotfix. This
action performs the following:○git flow hotfix finish <MYHOTFIX>
●Merged MYHOTFIX into “master”.●Removes the hotfix branch.●Switches back to “develop” branch.
![Page 22: git-flow R3Labs](https://reader035.fdocuments.in/reader035/viewer/2022070509/58a058cb1a28ab5c1c8b56c5/html5/thumbnails/22.jpg)
Commit your work●Commit your work after you finish the hotfix.
○git commit origin --all○git push origin --tags