Go with the Git flow

9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€47.39
List Price:  €66.35
You save:  €18.96
£39.48
List Price:  £55.27
You save:  £15.79
CA$69.93
List Price:  CA$97.91
You save:  CA$27.98
A$76.86
List Price:  A$107.61
You save:  A$30.75
S$67.15
List Price:  S$94.02
You save:  S$26.86
HK$389.09
List Price:  HK$544.76
You save:  HK$155.66
CHF 44.28
List Price:  CHF 61.99
You save:  CHF 17.71
NOK kr552.48
List Price:  NOK kr773.52
You save:  NOK kr221.03
DKK kr353.46
List Price:  DKK kr494.87
You save:  DKK kr141.41
NZ$85.02
List Price:  NZ$119.04
You save:  NZ$34.01
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.45
৳5,952.52
List Price:  ৳8,334.01
You save:  ৳2,381.48
₹4,217.70
List Price:  ₹5,905.12
You save:  ₹1,687.41
RM223.53
List Price:  RM312.96
You save:  RM89.43
₦83,723.75
List Price:  ₦117,219.95
You save:  ₦33,496.20
₨13,842.48
List Price:  ₨19,380.58
You save:  ₨5,538.10
฿1,735
List Price:  ฿2,429.14
You save:  ฿694.14
₺1,722.82
List Price:  ₺2,412.08
You save:  ₺689.26
B$289.31
List Price:  B$405.06
You save:  B$115.74
R905.17
List Price:  R1,267.31
You save:  R362.14
Лв92.66
List Price:  Лв129.73
You save:  Лв37.07
₩69,838.72
List Price:  ₩97,779.80
You save:  ₩27,941.07
₪186.81
List Price:  ₪261.55
You save:  ₪74.74
₱2,950.38
List Price:  ₱4,130.77
You save:  ₱1,180.39
¥7,786.65
List Price:  ¥10,901.93
You save:  ¥3,115.28
MX$1,010.13
List Price:  MX$1,414.26
You save:  MX$404.13
QR181.66
List Price:  QR254.33
You save:  QR72.67
P677.69
List Price:  P948.83
You save:  P271.13
KSh6,473.70
List Price:  KSh9,063.70
You save:  KSh2,590
E£2,484.50
List Price:  E£3,478.50
You save:  E£994
ብር6,130.69
List Price:  ብር8,583.46
You save:  ብር2,452.76
Kz45,623.90
List Price:  Kz63,877.12
You save:  Kz18,253.21
CLP$48,554.78
List Price:  CLP$67,980.58
You save:  CLP$19,425.80
CN¥362.25
List Price:  CN¥507.18
You save:  CN¥144.93
RD$2,999.87
List Price:  RD$4,200.06
You save:  RD$1,200.18
DA6,670.19
List Price:  DA9,338.81
You save:  DA2,668.61
FJ$113.51
List Price:  FJ$158.92
You save:  FJ$45.41
Q384.54
List Price:  Q538.38
You save:  Q153.84
GY$10,416.21
List Price:  GY$14,583.53
You save:  GY$4,167.31
ISK kr6,885.62
List Price:  ISK kr9,640.42
You save:  ISK kr2,754.80
DH497.67
List Price:  DH696.78
You save:  DH199.10
L909.82
List Price:  L1,273.82
You save:  L364
ден2,912.40
List Price:  ден4,077.60
You save:  ден1,165.19
MOP$399.33
List Price:  MOP$559.09
You save:  MOP$159.76
N$900.58
List Price:  N$1,260.89
You save:  N$360.30
C$1,833.12
List Price:  C$2,566.52
You save:  C$733.39
रु6,730.44
List Price:  रु9,423.16
You save:  रु2,692.71
S/189.03
List Price:  S/264.65
You save:  S/75.62
K200.43
List Price:  K280.62
You save:  K80.18
SAR187.67
List Price:  SAR262.75
You save:  SAR75.08
ZK1,376.04
List Price:  ZK1,926.57
You save:  ZK550.52
L235.82
List Price:  L330.17
You save:  L94.34
Kč1,197.77
List Price:  Kč1,676.98
You save:  Kč479.20
Ft19,418.42
List Price:  Ft27,187.34
You save:  Ft7,768.92
SEK kr549.81
List Price:  SEK kr769.78
You save:  SEK kr219.97
ARS$50,077.77
List Price:  ARS$70,112.88
You save:  ARS$20,035.11
Bs345.44
List Price:  Bs483.65
You save:  Bs138.20
COP$220,323.37
List Price:  COP$308,470.35
You save:  COP$88,146.97
₡25,320.40
List Price:  ₡35,450.59
You save:  ₡10,130.18
L1,258.58
List Price:  L1,762.11
You save:  L503.53
₲387,944.27
List Price:  ₲543,153.02
You save:  ₲155,208.75
$U2,137.07
List Price:  $U2,992.07
You save:  $U855
zł205.58
List Price:  zł287.83
You save:  zł82.25
Already have an account? Log In

Transcript

It is by far the most popular version control system out there. In this chapter we will be looking at a plugin for gate called get flow, which proposes a branching model for software projects. This branching model doesn't offer much help when it comes to small projects, but medium size and large projects have a lot to benefit from it. We will be looking at a variation of the get flow plugin called lead flow avh which adds extra functionality like get hooks. To install it, we will follow the instructions on the GitHub page. We are on Ubuntu so we will follow the installation instructions for Linux.

We can see that it can be directly installed from a with the apt command but usually apt does not contain the latest version of the software. So today we will do a manual installation. We want to pick the stable version and use the one line command Let's create an empty directory and initialize it as a get repository. Basic get use it is not the purpose of this course, we are assuming that you understand the basics. A good way to get started with good flow is to read the excellent cheat sheet created by Daniel Kumar. This provides the basic tips and tricks to get you started quickly with a program.

So the first thing that he suggests is to run get flow in it. To configure it, we actually answer a bunch of questions about what names the branches should have in each flow. And what is the version tag prefix and hooks directory. Let's just leave the defaults in. All right, if we run get branch We can see that we are now on the developer side. So no more developing on the master branch.

This helps us have a stable master. While not so stable features are kept on the development branch. If we go back to the cheat sheet, we can look at the first item which is feature branch. feature branches are useful when developing a specific part of functionality, or doing refactoring. But you don't want to break the existing functionality on the develop branch. To create a feature branch, just run, get flow feature start feature one.

Now this is not the most intuitive description of the feature, but it's good for demonstration purposes. Good flow will also show us a summary of actions once the feature branch is finished. This has created a new branch called feature slash feature one based on this Develop branch and has switched us to that branch. We can also see this from our handy virtual prompt. Let's open up a file, edit and save it. It status.

This command will tell us that we have an uncommitted file. Let's go ahead and commit it. Now get committed using the nano editor for editing the commit message. Since we prefer vim, let's go ahead and change the default editor to be all we need to do is to add the sign in our shell config file and reload it. export the return equal view. Now when we do a git commit, vim opens up shows us a summary of the commit and closes.

Now let's assume that we are we finished adding feature it's time to merge the feature branch back to develop with get flow feature finish feature one. Again, to get the summary of actions, the feature branch was merged back to develop, then the feature branch has been deleted that the current branch will be switched back to develop. If we do a LS we see the file from our branch present on the develop branch. Looking at the cheat sheet, we see a graphical representation of this process. Next up is starting release. Release branches are good for stopping the incoming features and bugs bug fixes from the development and testing the current version, submitting bug fixes on it and releasing it to the general public.

As we can see, the syntax is similar the process is similar the Develop is branched to our list branch. And when it comes to finishing the branch, the features are also merged to the master branch and the tag is cut from this branch. Time to see it in action. Oh, okay, this switches us over to release slash 1.0 point oh branch. Let's add our release notes dot txt to show what has changed in this release. I added more bugs, hopefully not to let's commit the file.

This is usually the case when you start to run your integration and stress testing to see if all is good and no bugs were found. After the testing is finished, we go ahead and finish our release branch. is good will prompt us for a series of release messages where we will Go with the default. Checking out the summary we can see that the release branch was merged into Master, a tag was cut from Master with the release version. That tag has also been merged into develop, the release branch has been deleted. And we're back on the develop branch.

If we do a get branch, we see the only two available branches are master and develop. Get tag tells us that there is a 1.0 point oh tag cut. We can see that the branch now contains two files from the merge of the feature and release branch. And if you also switch to the master branch, we can see that at this point master is an exact replica of develop, get flow. One has more workflows than the ones presented. We won't go through all of them today.

You can get extra information by visiting the cheat sheet page or by reading the instructions on the GitHub page. Get flow also comes with an enhanced hooks functionality. If you read the documentation, we can see all the possible hooks in the hooks folder. Let's add a gate hook that will be executed before every hotfix branch. For this, we just opened the template, copy the content and paste it to a file with the name pre flow hotfix. Start in our hooks directory.

Let's just simply echo a message with the version and origin. If we look at the hotfix flow, we can see they are created from the master branch and merge back to master and develop with the tag on master. Let's try and see how it works. Apparently not something went wrong or script was not executed and we need to delete our branch. Then we just do our get flow hotfix delete branch analyzing the get hooks directory, we see that our hook does not have execute permission. After adding execute permissions and running the get hook command again we can see our message on the top of the hotfix output.

Let's finish this hotfix with get flow hotfix finished 101 Okay, as you can see the commands are pretty straightforward. There is also an Omi is a shell plugin that you can activate to have command line completion. As we said in the beginning, this is a plugin suitable for teams of developers working on multiple features fixing bugs, releasing hot fixes, all of these in the same time. Get flow is really simple to learn and helps teams have a correct To workflow where they can easily prepare patches for production code without worrying about the extra functionalities developed on the master branch. You can tweak the config as you like. Some people prefer to place the hooks folder in a different place so that it is committed on the heat rebel and they don't have to worry about copying the files over.

Others continue to develop on the master branch and use a separate branch like customer for the production code.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.