A Secret Technique That My Team Uses In Developing Mobile App

Photo by Kristina Flour on Unsplash

So a long story short, I was taking one of the courses at my university, especially majoring in computer science, namely software projects (Proyek Perangkat Lunak). As the name implies, in this course I was given the task of creating a team of five people and making software with predetermined topics. My team got the topic of creating mobile applications that are involved in academia, especially in the field of law. The name of the application is Pantau Peradilanmu. Well, in this article I will briefly explain what techniques my team used in collaborating to develop the application.

Sorry for creating a clickbait title. In fact, I believe that what I will discuss in this article is no longer a secret. The techniques my team uses in collaborating to develop mobile applications are the most widely used modern version control system in the world today and the name is Git.

https://imgs.xkcd.com/comics/git.png

What is Git?

Git is a mature, actively maintained open-source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. A staggering number of software projects rely on Git for version control, including commercial projects as well as open-source.

I’m an egotistical bastard, and I name all my projects after myself. First Linux, now git. — Linus Torvalds, creator of Linux and Git

How I Use Git to Collaborate with My Team?

Setting up a repository

I do not need to initiate a local repository using the git init command because the repository in GitLab has been previously created by the scrum master, so I use the git clone command to copy the repository.

git clone <repo> <directory>

Saving Changes

I use the git stash command for temporary shelves (or stashes) changes I’ve made to my working copy so I can work on something else, and then come back and re-apply them later on with the git stash pop command.

git stash
git stash pop

Undoing Changes

I use the git revert command when I want to undo a specific commit to a project I’m working on. I implemented this when I found a bug or error in the commit without deleting the commit afterward, then git revert will automatically add new commits that do not contain the undoed commit.

# Example:
git revert HEAD [master b9cd081] Revert "prepend content to demo file" 1 file changed, 1 deletion(-)

Rewriting History

I use the git rebase command when I want to keep the commit history of my branch clean when there is a new update from the staging branch.

git rebase <base>

Syncing

I use the git remote command to link my local repository with the online repository on Gitlab.

git remote add <name> <url>

After connecting to the online repository on GitLab, I can do the git push command to update any new files and commits I work on from the local repository to the online repository so that my teammates can see and use my work done in the meantime.

git push <remote> <branch>

I can also do the git pull command to get the latest updates from the online repository.

git pull <remote>

Using Branches

In short, it is necessary to use branches to collaborate with my teammates so that any work that is done by each team does not cause conflicts. In accordance with GitFlow from PPL 2021, my team created several branches, including:

  • Branch Master: the main branch that stores source code ready to deploy into a production environment. The source code stored in this branch is ready to be used by the user.
  • Branch Staging: the branch mainly associated with the development process. This branch will store the source code of the work of each developer collected in one place. The applications that will be used during the sprint review come from this branch.
  • Branch PBI[1...n]: a branch for the implementation of a Product Backlog Item taken on a Sprint. Later, there will be several Product Backlog Item branches named according to the name of the Product Backlog Item being developed.
  • Branch Hotfix: It is a branch of the master branch that is created if there is a bug or error on the master branch. The hotfix branch is used as a place to fix bugs that occurred in the master branch. Once the bug is fixed and ready to be delivered, the hotfix branch is merged back to the master branch.
  • Branch Coldfix: This is a branch created to roll back (delete all changes
    of all product backlog item branches). This can happen when doing
    sprint reviews, the product owner rejects any or all of the product backlog items implemented for release.

Creation of these branches using the git branch command as shown below.

git branch <branch>

I can also use the git checkout command to create a new branch.

# Example
git checkout -b <pbi-name> staging

However, I usually use the git checkout command to switch from one branch to another.

git checkout <branch>

git merge
When I have finished implementing the features on a particular PBI branch it must be merged with the staging branch using the git merge command.

# Example:
git checkout staging
git merge PBI-1

That’s all I can share regarding secret techniques that are no longer a secret. Thank you for reading this article. I hope you like it.

Computer science student at Universitas Indonesia