GitLab/Workflows

= Making a GitLab Merge Request =

GitLab is a code hosting, review, and continuous integration platform.

We're running a community consultation on moving from Gerrit to GitLab for Wikimedia code review.

This is a tutorial which explains how to use our trial GitLab instance for Wikimedia development. Depending on the result of the consultation, it may become a reference for production use.

Register an account on gitlab-test
Accounts on the test instance are not currently tied to Wikimedia developer accounts. Visit gitlab-test.wmcloud.org/users/sign_in to register.

Add an SSH key
Visit the SSH settings in your profile and add a public key. See the GitLab documentation for more details on this process.

Create a branch
Use the convention :

Make your changes
Write some code and save your changes.

Stage and commit your changes
Let's say you've edited the  in. You should be able to see this using :

Stage the file and commit:

You should now be able to see this commit in the log:

Forking a repository
If you don't have developer-level permissions on the project you'd like to contribute to, you'll first need to copy the repository to your own account. This is known as "forking". Visit the repository page, for example gitlab-test.wmcloud.org/mediawiki/core, and click "Fork" in the upper righthand corner.

Next, add a remote for your fork:

If you've done this successfully, it should show up in your remotes:

Push your commit to GitLab
If you're working with a fork, you'll need to push to that upstream instead:

structure we're yoinking, ish
2 What is GitLab?

6 Prepare to work with GitLab (maybe nothing needed)

A lot of this is implicit in people's existing GitHub knowledge, if we're honest

7 Submit a patch

7.1 Update master

7.2 Create a branch

7.3 Make your changes

7.4 Stage your changes for a commit

7.5 Commit your staged changes

7.6 Prepare to push your commit to Gerrit

7.7 Push your commit to GitLab

7.8 View the Change / Next Steps

8 Other common situations

8.1 Squash several commits into one single commit via rebase

8.2 Amending a change (your own or someone else's)

8.3 Push to a branch different than master

9 Editing via the web-interface

10 How code is reviewed in Gitlab

10.1 Review before merge

10.2 Who can review? Gitlab project owners

10.3 How to comment on, review, and merge code in GitLab

10.3.1 Viewing and commenting on code

10.3.2 Comparing patch sets

10.3.3 Formally reviewing and merging or rejecting code

Additional Info

 * Branching models for repos