Gitlab notes

From raju


repository url

Sample repository url<user>/<project>.git<user>/<project>.git

password less cloning of repository only works with SSH. For example

    git clone<user>/<project>.git

If the repository is already checked out via HTTPS and you want to change it to SSH

    git remote set-url origin<user>/<project>.git


  • To disable markup formatting in the issue tracker, enclose the text in <pre> and </pre> tags

generate new recovery codes with an ssh key

    ssh 2fa_recovery_codes

See (2) in

test ssh connection

    ssh -T

highlight variable names in merge request discussions

Enclosing the variable names with ` ` will highlight them.

which gitlab version am I running

login into gitlab -> click the help button on top right -> help

you can also go directly to

As of 2020-07-06, I am on GitLab Enterprise Edition 13.2.0-pre


gitlab-runner status

The status command has to be run in a unix-y terminal (ex:- git bash) with admin privileges.

On a windows command prompt with admin privileges, I get warnings such as

    time="2019-10-09T17:49:59+01:00" level=info msg="Failed to set console mode for cli" error="The parameter is incorrect."

On a windows command prompt with no admin privileges, I get the following error (along with the above warnings)

    gitlab-runner: Access is denied.

But if I use git bash with admin privileges, then there are no errors.

tested on | windows server 2012R2


documentation links

gitlab CI

useful links

enable CI

To enable CI on a per project basis

Settings > General > Visibility, project features, permissions
-> Repository -> Pipelines -> Enable -> Save changes


build directory

Issue: gitlab CI does not create a new build directory on the next CI runs?

Explanation: The name of the build directory may be the same. But it is created fresh before initiating the new run.

Design question: Is it better to delete the build directory yourself once the CI pipeline completes (say in after_script)?

Decision: No, do not do it. If the build were to fail for some reason, this directory can help debug and identify the issue. Gitlab anyway cleans it up before starting a new CI pipeline. So the space gain in between is not worth it.

only except

Run only on some branches

        - branch1
        - branch2