<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Irfan Junaidi on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Irfan Junaidi on Medium]]></description>
        <link>https://medium.com/@irfancen?source=rss-bef8e907f5e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-kHjy2HAMH45sowgjdfmfQ.jpeg</url>
            <title>Stories by Muhammad Irfan Junaidi on Medium</title>
            <link>https://medium.com/@irfancen?source=rss-bef8e907f5e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:27:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@irfancen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Test Driven Development]]></title>
            <link>https://irfancen.medium.com/test-driven-development-adcfa2ad5f93?source=rss-bef8e907f5e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/adcfa2ad5f93</guid>
            <dc:creator><![CDATA[Muhammad Irfan Junaidi]]></dc:creator>
            <pubDate>Thu, 12 May 2022 16:44:44 GMT</pubDate>
            <atom:updated>2022-05-12T16:44:44.747Z</atom:updated>
            <content:encoded><![CDATA[<h4>A development process where implementing tests comes first!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6NmVaudfnEdmNcqt.png" /><figcaption>TDD by MonkeyUser (<a href="https://www.monkeyuser.com/2018/applied-tdd/">Source</a>)</figcaption></figure><p>It is quite common that you need to test your software before going to production. But how about testing the software before finishing or even implementing the code? Though it may sound weird to some people, Test Driven Development (TDD) have been used by many developers from time to time as developers tend to produce fewer bugs. It also may cause a slow development process at the start, the need to maintain tests, and may be difficult to do for people who’s just starting out.</p><h3>So how do you implement TDD exactly?</h3><p>TDD follows the concept “RED, GREEN, REFACTOR”, RED means writing a test that fails, GREEN means implementing the code that pass the test, and REFACTOR means cleaning your code without changing its implementation. In the RED phase, developers creates the tests for the code that will be implemented. For best practices, it is recommended to mark the commits with the current phase, in this case, I usually mark it as “[RED] My Commit”.</p><p>After creating the tests, you can start implementing the codes so that the code passes tests you’ve made before. Once you’re finished implementing the codes and passed the tests, you can commit your work with the tag [GREEN] as a mark that the feature you implemented runs correctly based on the tests.</p><p>Sometimes, you don’t always add new features to your software. Instead, you try to improve them by using better performing codes or even cleaning some of the smelly codes that you’ve wrote. By doing any of those mentioned before, you might want to label your commits with the tag [REFACTOR] to show that you refactored the code base. Do note that it still counts as refactoring as long as the behavior of the code stays the same. To know more about Refactoring, you can read <a href="https://irfancen.medium.com/refactoring-ec77022c36e8">my article</a> about the topic.</p><h3>What are the benefits for using TDD?</h3><p>Of course people won’t use certain methods if it has no gain for them, here are the benefits of using TDD.</p><ol><li><strong>Modular Software Design</strong>, by using TDD, developers are forced to focus on a single feature at a time until the tests for that feature has passed, making it easier to discover bugs since the codes corresponds to certain test.</li><li><strong>Easier to Maintain Code</strong>, developers tend to produce a more cleaner, more readable, and more manageable code due to TDD. Because of focusing on smaller code fragments, it requires less effort for developers to maintain the code.</li><li><strong>Better Code Documentation</strong>, the unit tests that are created acts as the documentation and describes how the code should work. This way, it is easier for developers to understand the code even without detailed documentation.</li></ol><p>Though some of you may think that TDD seems to be flawless at this point, every approach has its ups and downs, including TDD.</p><h3>The drawback of TDD</h3><ol><li><strong>Slow Development Process</strong>, like most romcom manga, the development process tends to be slow, especially in the beginning. The implementation of the codde may not be ready on time since the developers will be writing tests before any implementation. Though in cases where the software development takes up to double digits sprints, TDD may be faster than your normal development process.</li><li><strong>Difficult to Learn</strong>, TDD may be quite challenging to learn and requires skill, dedication, as well as discipline because the method is quite different where people usually starts. It is also difficult to do if you’re new to a certain framework as you might not know yet how to implement some features, thus unable to make the tests.</li><li><strong>Committed Team</strong>, involvement of the entire team is crucial in TDD. Everyone needs to believe in the importance of the TDD process, even when the team needs to re-write code because of the change in requirements.</li></ol><h3>My team’s TDD process</h3><p>Here is an example of how my team uses TDD in our project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*KT4K6J6Pw-uVmRq0oLFCyQ.png" /><figcaption>Commit History in our project</figcaption></figure><p>The picture above shows how we mark commits based on the phase we’re currently working. The commit with the RED tag shows that the test fails, while the one with the GREEN tag passed the tests.</p><p>Here’s a picture of the test I made on the RED marked commit above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBlALCVKbvIhdChv229-PA.png" /></figure><p>And here’s a picture of the implementation of the test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*eP_1vRDGdUaTmv0WlGcFPA.png" /></figure><h3>Should we implement TDD?</h3><p>In my opinion, aside from Agile, TDD really tidies how my team develop software. Though it may not be faster, it really has a positive impact on the software we’re working on. But, depending on your project, you may want to discuss it with your team whether all of you want to commit in using TDD.</p><p>References:</p><p><a href="https://fortegrp.com/test-driven-development-benefits/">How test-driven development help business: benefits of TDD | Forte Group</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adcfa2ad5f93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Refactoring]]></title>
            <link>https://irfancen.medium.com/refactoring-ec77022c36e8?source=rss-bef8e907f5e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec77022c36e8</guid>
            <dc:creator><![CDATA[Muhammad Irfan Junaidi]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 13:14:41 GMT</pubDate>
            <atom:updated>2022-04-12T14:43:37.755Z</atom:updated>
            <content:encoded><![CDATA[<h4>The art of changing an implementation without changing how it behaves</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KqVJ2mCy6ABuydd3.png" /><figcaption>Refactoring by MonkeyUser (<a href="https://www.monkeyuser.com/2018/refactoring/">Source</a>)</figcaption></figure><p>We’ve finally come to a moment where you finished implementing something and completed all the test given for that implementation to make sure that your software is working perfectly as intended. Now what?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/0*q-nMW0xAtVq2d6uZ.png" /><figcaption>Just the word refactor</figcaption></figure><h3>What is refactoring anyway?</h3><p>According to Martin Fowler from Refactoring.com, Refactoring is a technique to restructure an existing code, altering its structure on the inside without changing how it behaves on the outside. We use this technique to “clean” or improve the code that we’ve made without changing its behavior. For example, you made a lot of similar classes on your code. By making a superclass for those classes to extend, you’re already refactoring your code. There are a lot more example such as removing unnecessary codes, changing design patterns, etc.</p><h3>Why should I Refactor my code?</h3><p>There are a lot of benefits that you’ll get by refactoring, since refactoring is part of implementing Clean Code.</p><ol><li><strong>Cleaner Code<br></strong>As mentioned before, by refactoring your code, your code will become cleaner and easier to understand. Cleaning up the mess in your code before it gets worse as you add more features to your software. A cleaner code will also help your teammates understand your code easier which can fasten your development velocity.</li><li><strong>Improve your application performance<br></strong>An application that is free from unnecessary classes, functions, or any other mess will run faster and smoother. Your software would response quicker and would lead to a better user experience.</li><li><strong>Saves time</strong><br>If you keep refactoring and make sure to keep your code clean as you add new lines of code to your software, it would take less time for you to understand and implement those new codes. This is due to your clean and clear code that you refactor constantly. This way you don’t need to spend that much time trying to understand that code you’ve write months or even years ago.</li><li><strong>Easier Debugging<br></strong>Bugs are annoying to deal with, especially on a source code with thousands of lines of code. With a code that is easy to understand, it would be easier for you to find and debug the bugs on your software.</li></ol><h3>When do I need to refactor?</h3><p>Now that you know why should you refactor, when do you need to do it. It is considerably good for you to refactor before you add updates or new features to your existing code. It is easier to build on your code in the future if you go back and clean up your code before adding anything new. Just after delivering your software to public is also a good time to refactor. You are likely to have more free time to refactor at this time and it would help the updates that you will make in the future.</p><h3>When you don’t need to refactor</h3><p>It is pretty often that when you create an implementation of something, it turns out that it is not good enough or it doesn’t meet the requirements of your client. So the software needs to be redesigned completely. This way, it is better to just start from scratch rather than refactor as it would be more efficient for you to do.</p><p>It is also common to skip refactoring if you are in a tight deadline. Forcing yourself to refactor on a short time frame might lead to frustration as you need to do additional coding and testing. This could be why a certain software may contain bugs after each release 👀.</p><h3>How my team refactor in our project</h3><p>On our project, we refactor our codes as part of the development process “Test Driven Development” or in short, TDD. In TDD, our commits are divided into three phases, Red, Green, and Refactor. On the refactor phase, we did exactly what I’ve wrote above. We refactor before adding new features, making sure the code is clean, without changing its behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*VTE-Uff1IqPZZ9Ckx0_Eng.png" /><figcaption>Commit message of my code refactoring</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*woVFPWwuy5uobF4Gt8_-lA.png" /><figcaption>Changes I made refactoring my code</figcaption></figure><p>In the picture above, I changed the Vue.js API reference I was using (Options API to Composition API). Though code has changed quite a lot, the behavior of the software stays the same. The changes that I made was intended to have a cleaner code and to keep up to date with the latest API.</p><h3>How refactoring affects our project</h3><p>Since we are working as a team, consistency between codes is recommended. Some of the features that are created by different people might have similar objects or functions. After pushing those features, we tried refactoring so that those similar objects or functions can be created just once and can be imported by the one that needs them. By doing this, our source code becomes cleaner and easier to understand. It is also easier to find bugs in our code as it is easier to understand them.</p><p>I guess that’s all I can tell you about Refactoring and how my team use it on our project. I hope that this article can encourage you to refactor your codes to have a better development process.</p><p>References:</p><ul><li><a href="https://refactoring.com/">Refactoring Home Page</a></li><li><a href="https://www.altexsoft.com/blog/engineering/code-refactoring-best-practices-when-and-when-not-to-do-it/">Code Refactoring Best Practices: When (and When Not) to Do It</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec77022c36e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Persona]]></title>
            <link>https://irfancen.medium.com/persona-3975a767d90f?source=rss-bef8e907f5e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3975a767d90f</guid>
            <dc:creator><![CDATA[Muhammad Irfan Junaidi]]></dc:creator>
            <pubDate>Mon, 11 Apr 2022 11:47:24 GMT</pubDate>
            <atom:updated>2022-04-11T11:47:24.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Persona and why should you care?</h3><h4>Introduction to Persona</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*wqKL_06MuQOpHGDh1pQArQ.jpeg" /><figcaption>Persona Illustration (<a href="https://99designs.com/blog/business/how-to-create-user-personas/">Source</a>)</figcaption></figure><p>When developing an application, it is quite often that you’ve heard of a user persona. A user persona is used as a tool in designing software. A persona helps create software as a persona describes how the user of your software will likely be. In this article, I will talk about what personas are and how my team creates one.</p><h3>What is a user a persona?</h3><p>According to the creator of user persona, Alan Cooper, it is a “hypothetical archetypes of the actual users. Although they are imaginary, they are defined with significant rigor and precision.” <a href="https://www.interaction-design.org/literature/topics/personas">Interaction Design</a> defined a user persona as a fictional character that you create to represent the user that will use your application. A persona usually consists of the fictional character’s background, goals, motivation, and frustrations.</p><h3>Why do we need persona?</h3><p>As mentioned before, a user persona helps us in creating software. The user determines whether the software is good or not. To know the user is to understand what they need from our software. Here are some benefits of building a persona for your project:</p><ol><li><strong>Builds empathy</strong><br>Empathy is the ability to understand what other people feel and see things from their point of view. Personas help software designers understand their users. It helps them to see the perspective of the users. Knowing the perspective of the user helps us understand what the users need and what they expect from the software.</li><li><strong>Serve as a guideline for your project<br></strong>It is quite common for designers to fall back on the design they like. Having a persona reminds us of who the users of our software will be and such designs should consider the users. At the beginning of the project, the persona is used to help in designing the looks and interaction of your software. Reaching the end of the project, the persona you make can also be considered when doing User Acceptance Testing.</li></ol><h3>What counts as a good persona?</h3><p>Since a persona is used as the guideline of your project, making a bad one may lead to chaos on your project as well. Here are the characteristics of a good persona:</p><ol><li>Even though a persona is fictional, it should not be made carelessly. It should be well observed and researched from real data.</li><li>Personas should represent the user’s behavior, not their roles</li><li>A persona focuses on how they interact with the software now, not how they interact with that software later.</li><li>A persona is focused on the goals and behavior when the user use that software</li></ol><h3>How do you create a persona?</h3><p>There is a variety of ways to make a user persona. Here are the general steps in making a user persona for your project.</p><ol><li><strong>Do some research on your user candidate<br></strong>The first step of making a persona is to collect information about the users to understand their mindsets, behaviors, and motivations. Accurate personas are based on actual research data, and more information collected will lead to a more realistic persona.</li><li><strong>Identify the user’s behavior<br></strong>We identify the user’s behavior to ease the process of grouping users based on the similarities of those behaviors. From that information, we can then create a fictional character that represents that group.</li><li><strong>Create the personas<br></strong>When creating a persona, it is important to avoid adding too many personal details as having just one or two personalities is good enough. Creating too many personas should also be avoided. The purpose of a persona is to give a brief idea of the users so that the developers are able to work on a design based on that persona. That’s why having 2–3 different personas should be just enough.</li><li><strong>Discover scenarios of interaction<br></strong>Persona alone isn’t good enough to describe a user candidate. Only when that persona is coupled with a scenario does it becomes valuable. Having a scenario helps the designers understand the main user flow of the software.</li><li><strong>Review them with your team<br></strong>When working as a team, communication is important. After you finished making the personas, share them among your teammates. This way, the whole team will be able to better understand what kind of people will they make this software to.</li></ol><h3>User Persona on my team’s project</h3><p>On our project, there will be two roles of user, Juru and Admin. Jurus are people who want to offer a variety of services, while Admin manages the Jurus that are registered to our site. We created two personas that represent what kind of users will use our software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*DQ4rnmdzZK6dymimyX88XA.png" /><figcaption>First Persona, Representing the Software Admin</figcaption></figure><p>The first persona is Zich Moore who is an admin for our software, which keep track of the users of our software. On the picture above you can see Moore’s personal information, goals, frustrations, and motivations as an admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*2Y95TAAF1XtuassT-EEJIw.png" /><figcaption>Second Persona, Representing a Freelance</figcaption></figure><p>The second persona is Elena Schariac who is a candidate user (Juru) for our software. Similar to the first persona, you can see Schariac’s personal information, goals, frustrations, and motivations but as a Juru.</p><h4>How user persona help my team’s project</h4><p>Having to have learned about personas from Interaction Design Course, we already know how and what to do when making persona. The persona we crated was used for the initial software design such as wireframe and mockup.</p><p>As we start to develop the software, we ask ourselves whether a certain feature is needed based on the personas that we’ve made. Other than that, the personas also helped us to straighten up our priorities. Since we have two types of users, we have to make two kinds of perspectives to the software. At the beginning of the development, we focused much more on the admin side of the software since the features are related to authentication and Juru management, hence the prioritization.</p><p>Near the end of each sprint, we also conduct a User Acceptance Test (UAT). On a UAT, we need to describe how the user interacts with the software being developed. Designing the UAT becomes much easier because of the personas we’ve made at the beginning of our project.</p><p>I guess that’s all I can share about personas and how my team used them on our project. I hope that you can also start using personas to help the development of your projects.</p><p>References:</p><ul><li><a href="https://xd.adobe.com/ideas/process/user-research/putting-personas-to-work-in-ux-design/">What Are User Personas and Why Are They Important? | Adobe XD Ideas</a></li><li><a href="https://moodup.team/blog/whats-a-user-persona-and-what-should-you-avoid-when-creating-them-2/">What&#39;s a User Persona and what should you avoid when creating them? | Mood Up team - software house</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3975a767d90f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Version Control Systems: Git]]></title>
            <link>https://irfancen.medium.com/version-control-systems-git-d50ba6827417?source=rss-bef8e907f5e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d50ba6827417</guid>
            <dc:creator><![CDATA[Muhammad Irfan Junaidi]]></dc:creator>
            <pubDate>Fri, 01 Apr 2022 16:13:23 GMT</pubDate>
            <atom:updated>2022-04-01T16:13:23.558Z</atom:updated>
            <content:encoded><![CDATA[<h4>Basics of Git</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*yvIxh6ZKAUHNfrUq.jpg" /><figcaption>Git Logo (<a href="https://www.techrepublic.com/article/how-to-install-git-on-android/">Source</a>)</figcaption></figure><p>You’ve probably used or encounter an application with a Version Control System in your life. So, what is a Version Control System exactly? In this article, I will tell you what Version Control Systems are and the Version Control System that my team and I use.</p><h3>What are Version Control Systems?</h3><p>Version Control Systems are basically a tool that keeps track of the changes you’ve made. If a mistake was made, you can return to the earlier versions of your file before the mistake occurred. It is different from just saving your file where you only have the latest changes you’ve made. Due to this feature, version control systems are extremely useful for programmers to maintain the source code to their software.</p><h3>Git</h3><p>Git is the one of the most common version control system out there. Developed by the creator of Linux kernel, Linus Torvalds. Git has been used on numerous commercial and open-source projects. Git was a new type of version control system when it first launched. Git is a distributed version control system, where others was a centralized version control system. Being a distributed version control system means that it has no centralized code base to pull from. Working with a local repository is also made possible since the full history of all the changes are distributed.</p><h3>Git Commands</h3><p>Git has tons of commands that you can mess around with, but this time I’m just going to show you some of the common ones. There is something that you need to configure before you start using Git.</p><p>You need to set up your username and email using the following command:</p><pre>git config --global user.name &quot;[YOUR_USERNAME]&quot;<br>git config --global user.email &quot;[YOUR_EMAIL]&quot;</pre><p>The above configurations are required for author information when you commit your changes.</p><h4>Starting Out</h4><p>There are two ways to start using Git, git init<strong> </strong>and git clone. Basically, git init creates an empty Git repository on the current directory and git clone clones an existing Git repository, creating a directory for the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-9nIw60RXBgEUR2jRGeBQ.png" /><figcaption>git init (initialize a Git repostory)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*skiYriYppxPTq99UZleEHA.png" /><figcaption>git clone (clone a Git repository)</figcaption></figure><p>git init is usually used when you first start out a new project, where git clone is used to continue an existing one. Using git init doesn’t automatically set a remote to push your changes to an online repository, where git clone does (if you are given the access to modify the repository).</p><p>To set a remote, we use the following command:</p><pre>git remote add origin [URL_TO_YOUR_ONLINE_REPOSITORY]</pre><p>After you initialize or clone a Git repository, you can start working on your project.</p><h4>Staging Changes</h4><p>After finishing your current work, you can see all the changes you’ve made using git status. Here I just modified the README.md file and then executed git status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*0Ec76JJtGaT6mejzggqRjw.png" /><figcaption>git status (view all changes)</figcaption></figure><p>As you can see, it says that our changes are not staged. We use git add<strong> </strong>to stage them and we use git restore<strong> </strong>to discard those changes.</p><p>(Tip: we can use “.” to stage/discard all changes or a folder name to stage/discard all the files in that folder)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*G1aWDNgeQHQN37r5B1yvGA.png" /><figcaption>git status after git add</figcaption></figure><p>Once we’re satisfied with our changes, we can commit the changes.</p><h4>Committing Changes</h4><p>We use git commit to commit the changes that we made. Committing changes is similar to the traditional saving and staging changes is used to group those changes. We can commit our changes directly with a commit message using git commit -m “[COMMIT_MESSAGE]”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*PjxCx61OqyrlApG_3Hb7MQ.png" /><figcaption>git commit -m “[COMMIT_MESSAGE]”</figcaption></figure><p>We can see all the past commits using git log. You can see below that our changes has been committed and is ready to be pushed to an online repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*rKO29YMgrXa2IxyrFoPRFw.png" /><figcaption>git log (shows all the past commits)</figcaption></figure><h4>Pushing Changes</h4><p>If you don’t want to save your work on an online repository, then this step is not required. To push your changes to an online repository, we use the following command:</p><pre>git push [REMOTE_NAME] [BRANCH_NAME]</pre><p>In my case, I would write it as:</p><pre>git push origin master</pre><p>By pushing your changes into an online repository, someday you might as well want to pull from one.</p><h4>Pulling Changes</h4><p>The git pull command is the opposite of git push. We use this command to update our local repository with the ones in our online repository. Similar with the push command, to pull changes we use the following command:</p><pre>git pull [REMOTE_NAME] [BRANCH_NAME]</pre><p>Like git push, the command would look like this:</p><pre>git pull origin master</pre><p>Though modifying the main (master) branch is not recommended as the main branch is usually used for production. You don’t want to destroy the whole software just by pushing your changes to the master branch. This is where branching comes in place.</p><h4>Branching</h4><p>The ability to create branches of the main source code has been the most useful tool of Git in working in a team. Git branches allow multiple people to modify the source code of your software simultaneously. My team and I created multiple branches based on the features we are making. By splitting up the work using multiple branches allow us to create software at a much faster rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikIel4NHVLikN-7Gk-nOSg.png" /><figcaption>List of branches of my team’s project</figcaption></figure><p>In order to create a branch, we use the command git branch [BRANCH_NAME]. After the branch is created, we can change branches using the command git checkout [BRANCH_NAME]. I don’t really like this way of making branches. When I need to create branches, I use git checkout directly with a -b option which creates and changes to that branch in one go. Here’s how the command will look like:</p><pre>git checkout -b [BRANCH_NAME]</pre><p>What to do after we finished working on our branch? Well it really is up to you. You could just make multiple variation of your source code. Though the main purpose of branching is splitting up work. We can combine the changes from multiple branches using git merge.</p><h4>Merging Branches</h4><p>The git merge command is used to merge the changes of a certain branch to the current one. For example, your friend had made a branch and you need the changes that he made in your branch. Assuming that you already have your friend’s branch locally, we can use the following command:</p><pre>git merge [YOUR_FRIEND&#39;s_BRANCH]</pre><p>If it doesn’t have any conflicts, then the branch should be merged. Do note that when merging branches a new commit will need to be created.</p><h4>Merge Conflicts</h4><p>It is quite common to see merge conflicts when using multiple branches. Merge conflicts happen when two or more branches modified the same code, therefore it needs to be resolved. Usually Git is able to resolve those conflicts automatically, but sometimes you need to manually resolve them. After the conflicts have been resolved, a new commit will need to be created also.</p><h4>Other Git Commands</h4><p>There are plenty more of Git commands available which you can explore on the official Git page. There is also a good cheat sheet by Atlassian that you can look up <a href="https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet">here</a>.</p><h3>Gitflow</h3><p>The workflow that my team and I use for our project is Gitflow. Gitflow is quite similar to feature branch workflow, but instead of just one main branch to pull from, we can have multiple ones. As you can see on the previous image (the list of branches on my team’s project), there are two branches that are marked as protected, <strong>master</strong> and <strong>staging</strong>. We have two main branches which acts as production and development branches, with the rest are feature branches.</p><p>The master branch can only be merged from the staging branch as we need to ensure that everything is working perfectly as intended. The master branch also can only be modified by the maintainer of the repository.</p><p>The staging branch can be merged from the feature branches only if at least two people have approved the changes. Here, we implemented what is called Code Review. Code review is where we review the code of each team member requesting for a merge request to the <strong>staging</strong> branch. The reason why we do code review is to ensure that the code being merged to the <strong>staging</strong> branch is bug free.</p><p>The feature branch is the branch each of us work from with a specific naming PBI-[PBI_NUMBER]-[FEATURE_NAME]. PBI here stands for Product Backlog Item which was determined during sprint planning.</p><p>Lastly, there’s a hotfix branch which is used to fix bugs in the main branch. This branch doesn’t have a long lifetime since it is just used to fix bugs.</p><p>I guess that’s all that I can tell you about Git and how my team and I use it on our project. I hope you might find this article useful and you are able to speed up your project development by using Git.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d50ba6827417" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>