-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitflow.qmd
57 lines (43 loc) · 2.03 KB
/
gitflow.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Gitflow {{< iconify fa6-solid code-branch >}} {#sec-gitflow}
[Git][git] is the version control system that underlies GitHub. Gitflow is an alternative git branching model that uses feature branches and multiple primary branches (vs one primary branch, e.g., "main").
Gitflow was originally proposed by [Vincent Driessen in 2010 on his blog][gitflowblog]. [A tutorial][gitflowtut] by the tech company Atlassian has a nice overview of Gitflow.
In Gitflow there are two primary branches: `main` and `dev` (see diagram below). Feature branches always branch off of `dev`. After feature branches merge back into `dev`, then `dev` is merged into `main`.
```{mermaid}
%%{init: { 'logLevel': 'debug', 'theme': 'default', 'themeVariables': {
'git0': '#57bfd3',
'git1': '#5F9157',
'git2': '#f4b840',
'git3': '#D26D6D'
} } }%%
gitGraph
commit tag: "v1.0"
commit
branch dev
checkout dev
commit
branch feature1
checkout feature1
commit
commit
checkout dev
branch feature2
checkout feature2
commit
commit
checkout dev
merge feature1
checkout main
merge dev
commit tag: "v2.0"
```
There are formal tools for using a Gitflow model, e.g., [nvie/gitflow](https://github.com/nvie/gitflow). However, we aren't using that tool or any others at the moment.
There is one component of Gitflow that we do not use right now: release branches.
## Further reading
(Taken from <https://github.com/nvie/gitflow>)
Reading: <http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/>
Screen casts:
* [How to use a scalable Git branching model called git-flow](http://buildamodule.com/video/change-management-and-version-control-deploying-releases-features-and-fixes-with-git-how-to-use-a-scalable-git-branching-model-called-gitflow) (by Build a Module)
* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt)
[git]: https://git-scm.com/
[gitflowblog]: https://nvie.com/posts/a-successful-git-branching-model/
[gitflowtut]: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow