|
| 1 | +# Git-Flow Basic Tutorial :memo: |
| 2 | + |
| 3 | +[English Version](README_en.md) |
| 4 | + |
| 5 | +[Git-Flow Tutorials - youtube](https://youtu.be/zXlta66thZY) |
| 6 | + |
| 7 | +[Git-Flow SmartGit Tutorials - youtube](https://youtu.be/ualXHytifbg) |
| 8 | + |
| 9 | +Before you start to understand Git-Flow, it is recommended that you have a basic understanding of Git. |
| 10 | + |
| 11 | +You can refer to the [Git-Tutorials GIT Basic Usage Tutorial](https://github.com/twtrubiks/Git-Tutorials) I wrote before. |
| 12 | + |
| 13 | +## What is Git-Flow |
| 14 | + |
| 15 | +There are many commands in Git. If you use Git-Flow, you will have some extra features. |
| 16 | + |
| 17 | +But these features are just combinations of basic functions. To put it simply, |
| 18 | + |
| 19 | +it's the concept of A = B + C + D. Of course, you don't have to worry about memorizing extra commands. |
| 20 | + |
| 21 | +There is a GUI interface (there are many sets to use, I use [SmartGit](http://www.syntevo.com/smartgit/)), and it is very convenient. |
| 22 | + |
| 23 | +## Why use Git-Flow |
| 24 | + |
| 25 | +When you are using Git by yourself, it must be very cool. You can decide how to commit or |
| 26 | + |
| 27 | +how to merge, or even which branch to develop on. But |
| 28 | + |
| 29 | +what if it's a multi-person collaborative development? Everyone has their own habits, wouldn't that |
| 30 | + |
| 31 | +be chaos? So Git-Flow was born. |
| 32 | + |
| 33 | +## Git-Flow is not a new technology, it is just a specification |
| 34 | + |
| 35 | +Many people, when they first see Git-Flow, will think, wow! What is this thing? It's so trendy. |
| 36 | + |
| 37 | +But it is just **a specification**, not a new technology. When a whole |
| 38 | + |
| 39 | +team follows a certain workflow, problems are less likely to occur. |
| 40 | + |
| 41 | +Git-Flow is a set of specifications. If you or your company are very familiar with Git, |
| 42 | + |
| 43 | +you can also define your own Flow. Not following Git-Flow |
| 44 | + |
| 45 | +will not cause any conflicts at all. |
| 46 | + |
| 47 | +## Git-Flow Model |
| 48 | + |
| 49 | + In Git-Flow, there are two main branches: |
| 50 | + |
| 51 | +***Master*** |
| 52 | + |
| 53 | +This branch is very stable and is production-ready at all times. It contains the latest release, which is the source code of the product. When anyone uses your product, the first thing they see is master. **We cannot make any commits directly on the master branch, we can only merge back from Release or Hotfix**. |
| 54 | + |
| 55 | +***Develop*** |
| 56 | + |
| 57 | +The development branch. The develop branch is branched from the master branch. This (develop) branch provides integration of different upcoming release features. So this branch may be unstable (have bugs). Usually, we don't commit directly on this branch either, but merge features in through merging. |
| 58 | + |
| 59 | +Master and Develop are two very important branches. In theory, these two branches should be well protected to avoid accidental deletion. |
| 60 | + |
| 61 | +In addition to the **Master** and **Develop** branches, Git-Flow also provides other branches: |
| 62 | + |
| 63 | +***Feature*** |
| 64 | + |
| 65 | +Feature development. This branch is branched from the develop branch and will eventually be merged back into the develop branch. For example, suppose there are two features, A and B, being developed by two people. These two people will respectively branch out two branches, A and B, from the develop branch. When they are finished, they will merge back to develop. |
| 66 | + |
| 67 | +***Release*** |
| 68 | + |
| 69 | +When we think that develop is already a very stable version, we will enter the release. This branch is branched from the develop branch. Usually, we will do a full test and pre-launch preparation (release version record) on this branch. After completing the release, we will merge back to master and develop. |
| 70 | + |
| 71 | +***Hotfix*** |
| 72 | + |
| 73 | +This branch is branched from the master branch. Usually, it is already online, but suddenly a very urgent bug is found. At this time, we will open a Hotfix to fix the bug. After completion, we will merge back to master and develop. |
| 74 | + |
| 75 | +## Using SmartGit to complete Git-Flow |
| 76 | + |
| 77 | +There are many similar GUI interfaces. You can find one that suits you. I will use [SmartGit](http://www.syntevo.com/smartgit/) for the introduction here. |
| 78 | + |
| 79 | +### Installing SmartGit |
| 80 | + |
| 81 | +Please go to [SmartGit](http://www.syntevo.com/smartgit/) to download the one that matches your operating system. |
| 82 | + |
| 83 | +There should be no problems with the installation. The place to pay more attention to is that if you are a non-commercial version, |
| 84 | + |
| 85 | +please choose non-commercial (as shown below). If it is a commercial version, please purchase a license. |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +Set some things to complete. |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +After entering SmartGit, please select the project first, and then we click the Git-Flow icon (as shown below). |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +Usually, we will choose **Full** for Git-Flow Type, which is the complete branch. |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +You will find that the two main branches in the lower left corner have appeared. |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +To add any Feature or Release, you can click the Git-Flow icon. |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +For more detailed introduction, please refer to |
| 110 | + |
| 111 | +[Git-Flow SmartGit Tutorials - youtube](https://youtu.be/ualXHytifbg) |
| 112 | + |
| 113 | +## Reference |
| 114 | + |
| 115 | +* [gitflow](https://github.com/nvie/gitflow) |
| 116 | + |
| 117 | +## Donation |
| 118 | + |
| 119 | +The articles are all original after my own research and internalization. If it has helped you and you want to encourage me, you are welcome to buy me a cup of coffee :laughing: |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +[Sponsor Payment](https://payment.opay.tw/Broadcaster/Donate/9E47FDEF85ABE383A0F5FC6A218606F8) |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +MIT license |
0 commit comments