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