{"id":109,"date":"2026-07-20T21:54:12","date_gmt":"2026-07-20T16:24:12","guid":{"rendered":"https:\/\/www.sushantmondal.com\/blog\/?p=109"},"modified":"2026-08-18T08:24:46","modified_gmt":"2026-08-18T02:54:46","slug":"creating-a-unified-coding-style-guide-for-github-and-gitlab","status":"publish","type":"post","link":"https:\/\/www.sushantmondal.com\/blog\/2026\/07\/20\/creating-a-unified-coding-style-guide-for-github-and-gitlab\/","title":{"rendered":"Creating a unified coding style guide for GitHub and GitLab"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I commit a lot to GitHub and my privately hosted GitLab server. To keep my coding style consistent across all my commits and repositories, I created <a href=\"https:\/\/github.com\/mondal-mondal\/coding-guidelines\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">mondal-mondal\/coding-guidelines<\/a> (yes, for that I had to create a GitHub organization for Mondal &amp; Mondal first!).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may ask why I had to create an organization for that. Why could not I just host the repository in my <a href=\"https:\/\/github.com\/mondalsushant\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">personal namespace<\/a>? It is because my brother also actively engages in the day-to-day research done in our private GitLab server. And for our future team members to be in our fleet pretty soon, I decided to spin off an organization to keep things &#8220;shared&#8221; instead of &#8220;personal.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because many of us work in collaborative teams and projects, especially if the project is open source, people often cannot settle on one coding convention or style that they can cleanly inherit for the entire project without a &#8220;style guide.&#8221; A &#8220;style guide&#8221; is nothing but some written rules on preferences while coding to avoid style arguments between a project&#8217;s members. That central &#8220;style guide&#8221; can be this new repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The repository is hosted on my private GitLab server, and a push mirror has been set up from GitLab to GitHub.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not worry if your merged PRs would be overwritten or not, because GitLab does not force push to GitHub as I turned on the &#8220;Keep divergent refs&#8221; feature! &#8220;Keep divergent refs&#8221; feature allows you to keep a divergent history, for example, a merged PR, in GitHub without overwriting it using the master copy that is administered by GitLab. This helps the GitHub community to contribute to this repository without their efforts being destructively erased by a force push from GitLab.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The young phase of this repository supports coding conventions across these languages only for now: Git, C++, Markdown, PlantUML, Python, and SystemVerilog.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How to contribute to the repository using pull requests (for GitHub first-timers!)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Any contribution to this repository, even for new languages that are still related and relevant to the RTL and verification industry, is appreciated. Follow the guide below to learn how to create a contribution, specifically a new GitHub <em>pull request<\/em> (PR):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Fork<\/strong> this repository from <a href=\"https:\/\/github.com\/mondal-mondal\/coding-guidelines\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">here<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"700\" src=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-fork-button.png\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-fork-button.png 940w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-fork-button-300x223.png 300w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-fork-button-768x572.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;or directly fork by clicking on this button:<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-small-font-size has-custom-font-size wp-element-button\" href=\"https:\/\/github.com\/mondal-mondal\/coding-guidelines\/fork\" style=\"border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><strong>Fork<\/strong> the repository &gt;&gt;&gt;<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Then, clone the forked repository to your local computer:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">git clone https:\/\/github.com\/&lt;your-github-username&gt;\/coding-guidelines<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">cd<\/code> to the cloned-repository directory and create a new branch from which you will create a PR:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">cd coding-guidelines\n\n# Create a new branch.\ngit checkout -b &lt;type&gt;\/&lt;description&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Refer to <a href=\"https:\/\/conventionalbranch.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Conventional Branch<\/a> to learn how to properly name your branch according to the type of the future PR.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the forked repository with your favorite code editor. I will open it with VS Code for a demonstration here:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make your necessary changes and do not forget to save them!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After making your changes, push your changes:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\"># Add all the files changed to the commit using the period wildcard.\ngit add .\n\ngit commit -m &quot;&lt;type&gt;[optional scope]: &lt;description&gt;&quot;\ngit push origin &lt;type&gt;\/&lt;description&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Refer to <a href=\"https:\/\/www.conventionalcommits.org\/en\/v1.0.0\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Conventional Commits<\/a> to learn how to write a clean commit message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After pushing your changes, you are now finally ready to open a new PR to the upstream repository:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your web browser and go to the <a href=\"https:\/\/github.com\/mondal-mondal\/coding-guidelines\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">original (upstream) repository<\/a> or your forked repository.<\/li>\n\n\n\n<li>Look for a yellow banner at the top that reads: &#8220;<code class=\"\" data-line=\"\">&lt;type&gt;\/&lt;description&gt;<\/code> had recent pushes less than a minute ago.&#8221;<\/li>\n\n\n\n<li>Click the green &#8220;Compare &amp; pull request&#8221; button next to it.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You created your first PR! Now wait for an admin (usually me) to check your commit and approve the changes proposed by your commit(s) if they are valid. Thank you for spending your valuable time to read this quick tutorial and grow this repository.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Star<\/strong> the repository on GitHub so you do not lose it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"390\" src=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-star-button.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-star-button.png 941w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-star-button-300x124.png 300w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo-star-button-768x318.png 768w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-contrast-color has-text-color has-background has-link-color has-small-font-size has-custom-font-size wp-element-button\" href=\"https:\/\/github.com\/mondal-mondal\/coding-guidelines\" style=\"border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;background-color:#eac54f;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>Star<\/strong> the repository &gt;&gt;&gt;<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">If you reached here, congratulations! You are one of the few people who actually care to grow the open-source world. Keep it up! See you next weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The author established a GitHub organization to promote shared coding guidelines for collaborative projects with his brother and future team members. This repository encourages contributions in various programming languages, ensuring consistency through established conventions. It simplifies the process for first-time contributors to submit pull requests effectively.<\/p>\n","protected":false},"author":1,"featured_media":136,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[15],"tags":[18,17,22,19,20,21,23,24,16,11],"class_list":["post-109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding-programming","tag-coding-conventions","tag-coding-guidelines","tag-cpp","tag-git","tag-github","tag-gitlab","tag-markdown","tag-plantuml","tag-style-guide","tag-systemverilog"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/07\/github-mondal-mondal-coding-guidelines-repo.png","_links":{"self":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":31,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":184,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions\/184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/media\/136"}],"wp:attachment":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}