App Development Best Practices -1 (Version Control)

This is an article series on app development best practices. We use react as an example but most of the practices are framework agnostic and in general applies to software development

Version Control is one of the very important aspect of software development. It is one of the first things that needs to be setup before beginning any new project. Software development working without version control is a big NO and you will shoot yourself in the foot very soon.

Version Control lets you

  1. Track changes to your application source code
  2. Help manage releases and documentation
  3. Help collaborate with other developers

Git is one of the most popular version control system. One some OS (ex mac) Git Client comes preinstalled. You can also install for your platform from Git.

I have a app bootstrapped from create-react-app and I have modified the title from to

create-react-app initialises the project with git, if git is already installed on your computer. You can see the folder that has created. Otherwise, the command used is

  1. : creates the necessary files that makes this directory recognisable as a git repository
  2. : gives you information on what has been changed

3. : adds the files to make it ready to be committed

4. : will commit the changes and marks it with a recognizable checkpoint (commit hash). This command takes a paramenter which is used to provide a human friendly message. The message is to briefly indicate the description of the changes. Ex:

There are some GUI tools such as SourceTree, Fork that you can use for git operations.

The following is a screenshot from SourceTree

has initialised (git init) the project mitt-butik , added project files to stage( git add) and created a commit (git commit -m “Initialize project using Create React App”) with the message “Initialise project using Create React App”

After that we have modified and add that to stage(git add src/App.js) and created a commit with the message “Updating title to Mitt Butik”

So we now have a workflow to record our changes. But this is only local to our system. We need to be able to store, share and collaborate our changes so that other developers can also work on it. This is usually done with a Git Server (Ex: Github, Gitlab, Bitbucket etc). The example uses Github.

We will create a project on Github with the same

Once you have created a project, Github tells how you can sync your changes for the first time

Since we had already created a repository locally, we will use the option “or push an existing repository from the command line”

After running those commands, we can see that our changes have been pushed to our project on Github server

You can find the repository at https://github.com/agenthunt/mitt-butik

Solving Problems. Making Software Better. Intrigued by Elegant Solutions. https://twitter.com/agent_hunt

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store