From 17de1cc49f5f55a709512c3c123f48e1a2509b45 Mon Sep 17 00:00:00 2001 From: Chip Oglesby Date: Fri, 25 Mar 2022 14:51:51 -0400 Subject: [PATCH] Create 2022-03-29-dont-merge-master.md --- _posts/blog/2022-03-29-dont-merge-master.md | 57 +++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 _posts/blog/2022-03-29-dont-merge-master.md diff --git a/_posts/blog/2022-03-29-dont-merge-master.md b/_posts/blog/2022-03-29-dont-merge-master.md new file mode 100644 index 00000000..c848a79d --- /dev/null +++ b/_posts/blog/2022-03-29-dont-merge-master.md @@ -0,0 +1,57 @@ +--- +title: "Developing Good Habits: Don't Commit Directly To Your Main Branch" +author: chipoglesby +comments: true +date: "2022-03-29" +layout: post +slug: dont-commit-to-your-main-branch +excerpt: You should treat each of your Github projects like you're working on a team. +published: false +categories: +- sidenote +--- + +I had a epiphany recently that I should start doing all of my documentation work in Markdown and +Git; instead of doing some in Google Docs, some in Confluence and some in plain-text files. + +As I started researching if other people were doing this I came across all different types of +stuff. There were software programs and many blog posts calling for the same type of thing! + +"This is great" I thought to myself as I read all of this. It felt like some type of validation +because I wasn't crazy for trying this and I wasn't alone. + +Then I came across an author who shared a lot of the same opinions I have on using Markdown +and in one of their posts they suggested "just commit your work straight to your main branch." + +This got me thinking about how although this is "OKAY" to do, it shouldn't be your best practice. +Getting into a habit of commit all of your work to a main branch, isn't just lazy, it's +also dangerous if you were to ever work in a development role that builds code. + +It reminds me of this meme I've seen before: + +**_"So you're not really supposed to do this, but this is what we do."_** -- Don't be that person. + +![](https://storage.googleapis.com/www.chipoglesby.com/wrong.jpg) + +Ideally, if you're working by yourself or with more than one person, you will be creating +branches to work on and then merging them into your main branch. + +This isn't a hard and fast rule, but it's kind of like driving without wearing your +seatbelt. If you don't, dangerous things can happen. + +Sometimes, depending on how I feel when I'm working on a side project, I will use +Issues and pull requests and comments, just like if I were collborating when a coworker +on a project. It's totally overkill when working by yourself, but it's also just good +practice. + +For example this (reproducible research template)[https://github.com/chipoglesby/reproducibleResearchTemplate] +that I came up with is a really great way to keep me organized and it lets +others see how I work through a project. Five or six years after I created that, +which OMG is this year!, I should be able to come back and still use it and +produce the same results as when I first created it. + +Personally, I feel like developing good habits in the small things helps you +be more successful in the large things. And please, don't get me wrong, I am +nowhere near perfect. There are things that I know I'm suppose to do that I don't +do because I need to cut a corner to make something work quickly or because I forgot +something. I try to make those instances the exception and not the rule.