Cli/ref/mw gitlab alias set

mw gitlab alias set
Set an alias.

Synopsis
Declare a word as a command alias that will expand to the specified command(s).

The expansion may specify additional arguments and flags. If the expansion includes positional placeholders such as ‘$1’, ‘$2’, etc., any extra arguments that follow the invocation of an alias will be inserted appropriately.

If ‘–shell’ is specified, the alias will be run through a shell interpreter (sh). This allows you to compose commands with “|” or redirect with “&gt;”. Note that extra arguments following the alias will not be automatically passed to the expanded expression. To have a shell alias receive arguments, you must explicitly accept them using “$1”, “$2", etc., or "$ @” to accept all of them.

Platform note: on Windows, shell aliases are executed via “sh” as installed by Git For Windows. If you have installed git on Windows in some other way, shell aliases may not work for you. Quotes must always be used when defining a command as in the examples.

mw gitlab alias set &lt;alias name&gt; '&lt;command&gt;' [flags]

Examples
$ glab alias set mrv 'mr view' $ glab mrv -w 123
 * 1) =&gt; glab mr view -w 123

$ glab alias set createissue 'glab create issue --title &quot;$1&quot;' $ glab createissue &quot;My Issue&quot; --description &quot;Something is broken.&quot;
 * 1) =&gt; glab create issue --title &quot;My Issue&quot; --description &quot;Something is broken.&quot;

$ glab alias set --shell igrep 'glab issue list --assignee=&quot;$1&quot; | grep $2' $ glab igrep user foo
 * 1) =&gt; glab issue list --assignee=&quot;user&quot; | grep &quot;foo&quot;

Options
-s, --shell  Declare an alias to be passed through a shell interpreter

Options inherited from parent commands
--help            help for this command --no-interaction  Do not ask any interactive questions --verbosity int   verbosity level (1-2) (default 1)