Welcome to GitLab Development Standards’s documentation!

This guide is for small software development team which use GitLab [1] as the only one tool to manage their daily work. If you are in a team like this, this documentation may help you and your team, no matter you are a project member or project owner.

GitLab provides Git repository management, code reviews, issue tracking, activity feeds and wikis. GitLab itself is also free software. GitLab also have integrated CI and CD to test, build and deploy your code.

Note

This guide is summaried from many many open sourced projects, and apply them to GitLab. Some of them maybe not so professional and perfect, but if you have no guide for your team at this moment, then this one will be a good one for you, if you have a better one, please give us some suggestions. Thanks.

Table of Contents

Git Usage

Branch

Commit

Merge

GitLab Tutorial

GitLab is a open sourced software, and it has two versions: community version and enterprise version. gitlab.com is hosted by gitlab.org, and everyone can put their code on it. Or you can deploy gitlab in your own machine.

Administration

There is for GitLab Administrator. How to install/configure/upgrade/maintain GitLab. If you chose gitlab.com to host your source code, then you can ignore this secion.

Install

Go to https://about.gitlab.com/downloads/ and select operating system, follow the guide. After that, open the browser and type the address.

Configuration

Edit /etc/gitlab/gitlab.rb then run gitlab-ctl reconfigure

Upgrade

Update is very easy, if the operating system is CentOS.

$ sudo yum install gitlab-ce

Maintain

For backup: please use the scripts: https://github.com/gitlabadm/auto-gitlab-backup

Project

Project is a git repository, and you can create or import your project from popular Git services.

Create an empty project

Import from GitHub/Bitbucket

Group

A Group is a collection of projects and all the projects in the same group are under the same namespace. If you already (or will) have more than one related git repository, please group them together and treat them as a group.

More information about group like memeber management can get from the screenshot below.

_images/group.png

Issue

Merge Request

Branch should be merged to master when you have finished some work, for example, you have fixed an issue or implemented a feature. You can create Merge Request in GitLab, and assign it to somebody in your team. Actually, you also can create a merge request which is working in progress.

You can create a MR by yourself, or use the templates.

Templates

There are issue template and merge request template. How to create merge request template? Just like issue template, you should create a markdown file in your git repository. The location should be in project_folder/.gitlab/merge_request_templates/xxx.md, xxx will be the name of the template.

Here is what a template look like [1] .

$ more .gitlab/merge_request_templates/default.md
**1. What this MR does / why we need it:**

-
-

**2. Make sure that you've checked the boxes below before you submit MR:**

- [ ] I have read [Contribution guidelines](https://gitlab.com/test/demo/blob/master/CONTRIBUTING.md)
- [ ] I have run `tox` locally and there is no error.
- [ ] no conflict with master branch.

**3. Which issue this PR fixes (optional)**


**4. CHANGELOG/Release Notes (optional)**


Thanks for your MR, you're awesome! :+1:

When you create a merge request and chose the template, it looks like this:

_images/merge_request.png

WIP

For the merge request which is working in the progress, please add WIP: in the beginning of the title. in that case, this merge reuqest can not be merged unless you remove WIP: from the tile.

_images/wip.png

Other Information

For Assignee, Milestone, Labels, this can be setted by the creator or the project manager.

How to Merge

The merge request can be merged by assignee when:

  • The GitLab CI passed
  • Code Review by a group of people, anyone can do code review.
  • Check out the branch and do the functional test if needed.
  • Other requirements

After Merge

There are some operations after merge:

  • Remove source branch (optional)
  • Check related issues and make sure close them
  • Check master branch’s build status
  • Others

Reference

[1]https://github.com/avelino/awesome-go/blob/master/.github/PULL_REQUEST_TEMPLATE.md

GitLab CI

Testing

Release Management

Continuous Integration

Support

There are many content need to be added. Please give us some suggestion through issues or PRs. Thanks.

Reference

[1]https://about.gitlab.com/

Indices and tables