GitLab is a web based collaboration tool built on GIT repository. GitLab’s community edition is free and we can setup a private hosted GIT repository on our server. GitLab provides a web based UI to manage the user accounts, repositories, projects and many other services it offers. GitLab runner is a deployment tool, where you can deploy your application using any deployment tool like “Docker” whenever a merge or commit runs on repositories.
Here we consider only the central repository, not the local repository layout. Layout design is applicable to GIT repository hosted on any platforms like GitHub, GitLab etc. When we think about multiple people working on the same project, the design of the repository layout matters. It is up to you to choose your repository layout which is suitable for your development environment. When we have a continuous development and integration on a project, my idea is to use multiple branches for each feature we prepare. GIT’s branching is very cheap and faster than any of the similar version control system.
Here is a layout i like to use with larger projects. In my repository, there is a master branch which is the primary source for the projects. Along with the master branch, i have 2 other branches which exist while there is a development progresses, which are “QA” and “Development”.
/master
/development
/qa
To start , all the branches may be blank. We have to create multiple feature branches for each feature developed by the developers. When the feature is completed, it will be committed to the local repo and pushed to remote / central repo (into feature branch).
For example, we have 3 features “Login”, “Customers” & “Products”, the layout of the repository changes as follows :
/master
/development
/qa
/feature-login
/feature-products
/feature-customers
When developers finish working on the “Login” feature, the branch is updated with the latest work. Similarly all feature branches are updated by git push command when they are ready for integration. The feature branches are merged in to the “development” branch. There is chance of merge conflicts which has to be resolved by the developers locally or during the merge process. From the development branch, application code can be deployed in to a development server and further developer testing is done. At one point, the development is over and the application is ready for testing. In my case, i have a separate test server, and i merge the development branch in to the qa branch. Test server is ready with the code from the qa branch, testing goes on.
In this kind of approach, the developers should have access to only the feature branches where they work. Al these merging and deployment should be done with an administrative privileged user. After merging the features in to the development, we can remove the feature branch from the central repo. Suppose, Q/A is finished and released the bugs report, again the developers has to checkout a working copy from the development branch and they start fixes the bugs.
After finishes the bug fixes, again the feature branches are merged in to development and when ready for testing, again in to the qa branch. This continues till we have a release for the project which is accepted by the product owner.
Each release can be created using GIT’s tags. Whenever the feature is resealed master branch is updated. Thus, the master branch will hold the latest working project whereas the releases keep track of the versions we create.
In GitLab, for each projects and repositories, there is many features associated and accessible through the web based UI. We can report issues, create wiki pages, create pipelines to automate the deployment using GitLab runner, host any code snippets etc.
Start using the GitLab and set up your private repository.




