Fresh gitlab commands for developers

This applies to the VTK master branch and the upcoming 9.6.0 release.

All VTK developers are familiar with git gitlab-push, but VTK also provides some other gitlab CLI commands (some only recently added) which can improve the gitlab experience.

The following command is useful for syncing gitlab changes back to your local branch, for example after executing Do: refomat in a gitlab merge request:

usage: git gitlab-sync [<remote>] [<options>...] [--]

OPTIONS

--dry-run
    Show what would be changed without actually updating

--autostash
    automatically stash/stash pop before and after

This command has been around for a long time, but it used to print odd and confusing diagnostics if it encountered any errors during the sync. Now, it should be much more reliable.

The following command is for fetching a gitlab merge request (usually someone else’s) to your local machine.

usage: git fetch-mr [--named <name>] [--force] <mr-id>

OPTIONS

--named <name>
    Use <name> for the local branch instead of mr-<mr-id>

--force
    Overwrite the local branch if it already exists

For example, git fetch-mr 12345 will create a local branch mr-12345. It creates the branch but does not check out the branch, i.e. your working tree remains unchanged.

1 Like