DEV Community

Cover image for Merges on Github

Posted on

Merges on Github

This is the 4th week I've been studying in OSD 600. And undoubtedly, it comes with my 3rd lab. About this Lab 3, it's way more easier for me comparing to the previous two labs. Because in this Lab 3, I'm going to work with my own SSG (Static Site Generator) that I made 2 weeks ago. Since I'm going to update my own code, it will saves me a lot of time to go through the logic and add some new features.


In this Lab 3, we are going to choose 2 features in the following 4 features our professor provided:
Feature #1: Add an optional -l, --lang, and/or \l flag, which indicates the language to use when generating the lang attribute on the root <html> element.
Feature #2: Make sure that the program exits with appropriate error codes in all cases. If there are no errors, exit with 0. Otherwise, exit with a non-zero exit code (e.g., -1).
Feature #3: Add support for inline<code>blocks. In Markdown, enclosing text in a single backtick causes the text to HTML to get rendered as <code>...text...</code>.
Feature #4: Add support for a horizontal rule in Markdown. The Markdown --- should get converted to an <hr> tag.
And the features I chose were Feature #1 and Feature #4


1. Issues

After determined the features I'm going to add. I made up 2 Issues for my features.
Issue #24: Add an optional -l, --lang, and/or \l flag.
Issue #25: Add support for converting Markdown --- to an <hr> tag.

2. Create Topic Branches

The following step is creating two branches Issue_#24 and
Issue_#25 of my issues so that I can work on them separately. And they won't impact each other or the original branch that my SSG located.
Here is the code I used for creating branches:

$ git checkout master
$ git checkout -b Issue_#24
$ git checkout -b Issue_#25
Enter fullscreen mode Exit fullscreen mode

3. Commit & Merge

And then I updated my code git add and committed them git commit to the specific branch I created. And the last step was merge them to the original(master) branch I have.
Just simply with the code:

$ git checkout master
$ git merge Issue_#24
$ git merge Issue_#25
Enter fullscreen mode Exit fullscreen mode

My Feelings

This is a simple lab for me. It doesn't have a lot of requirements and I don't need to work on other people's code which saved me a lot of time to understand the logic of the code.
Working with branches is a excellent idea when it comes to a huge public program. Imagine there are more than 200 people working in a same project, and each of them have a different task to update the project. Using branches allow them to work separately. Once any of them finished the work, they can just pull a request and then the owner of the project decide to merge it to the main program or not.
And this Lab 3 gained me a good experience working on Github Merge!

Link to my repo: []

Top comments (0)