aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2023-05-23-i-was-wrong-about-git-workflows.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/2023-05-23-i-was-wrong-about-git-workflows.md')
-rw-r--r--content/posts/2023-05-23-i-was-wrong-about-git-workflows.md71
1 files changed, 0 insertions, 71 deletions
diff --git a/content/posts/2023-05-23-i-was-wrong-about-git-workflows.md b/content/posts/2023-05-23-i-was-wrong-about-git-workflows.md
deleted file mode 100644
index 16739de..0000000
--- a/content/posts/2023-05-23-i-was-wrong-about-git-workflows.md
+++ /dev/null
@@ -1,71 +0,0 @@
1---
2title: I think I was completely wrong about Git workflows
3url: i-was-wrong-about-git-workflows.html
4date: 2023-05-23T12:00:00+02:00
5draft: false
6type: posts
7tags: []
8---
9
10I have been using some approximation of [Git
11Flow](https://jeffkreeftmeijer.com/git-flow/) for years now and never really
12questioned it to be honest. When I create a repo I create develop branch and set
13it as default one and then merge to master from there. Seems reasonable enough.
14
15One thing that I have learned is that long living branches are the devil. They
16always end up making a huge mess when they need to be merged eventually into
17master. So by that reason, what is the develop branch if not the longest living
18feature branch. And from my personal experience there was never a situation
19where I wasn’t sweating bullets when I had to merge develop back to master.
20
21This realisation started to give me pause. So why the hell am I doing this, and
22is there a better way. Well the solution was always there. And it comes in a
23form of [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
24
25So what are git tags? Git tags are references to specific points in a Git
26repository's history. They are used to mark important milestones, such as
27releases or significant commits, making it easier to identify and access
28specific versions of a project.
29
30Somehow we have all hijacked the meaning of the master branch that it has to be
31the most releasable version of code. And this is also where the confusing about
32versioning the software kicks in. Because master branch implicitly says that we
33are dealing with the rolling release type of a software. And by having a develop
34branch we are hacking around this confusion. With a separation of develop and
35master we lock functionalities into place and forcing a stable vs development
36version of the software.
37
38But if that is true and the long living branches are the devil then why have
39develop at all. I think that most of this comes to how continuous integration is
40being done. There usually is no granular access to tags and CD software deploys
41what is present on a specific branch, may that be master for production and
42develop for staging. This is a gross simplification and by having this in place
43we have completely removed tagging as a viable option to create a fix point in
44software cycle that says, this is the production ready code.
45
46One cool thing about tags are that you can checkout a specific tag. So they
47behave very similarly as branches in that regard. And you don’t have the
48overhead of having two mainstream branches.
49
50So what is the solution? One approach is to use development workflow, where all
51changes are made on the smaller branches and continuously merged into
52master. Where the software is ready to be pushed to production you tag the
53master branch. This approach eliminates the need for long-lived branches and
54simplifies the development process. It also encourages developers to make small,
55incremental changes that can be tested and deployed quickly. However, this
56approach may not be suitable for all projects or teams that heavily rely on
57automated deployment based on branch names only.
58
59This also requires that developers always keep production in mind. No more
60living on an island of the develop branch. All your actions and code need to be
61ready to meet production standards on a much smaller timescale.
62
63I think that we have complicated the workflow in an honest attempt to make
64things more streamlined but in the process of doing this, we have inadvertently
65made our lives much more complicated.
66
67In conclusion, it's important to re-evaluate our workflows from time to time to
68see if they still make sense and if there are better alternatives available.
69Long-living branches can be problematic, and using tags to mark important
70milestones can simplify the development process.
71