Manual:$wgGitRepositoryViewers

Details
Maps Git repository URLs to viewer URLs to provide links in version>Special:Version|Special:Version. version>Special:Version|Special:Version looks up git remote configuration and identifies a correct git remote entry for the branch of code that is currently being run.

This URL needs to be converted in to the gitweb interface URL (if available), so that git revision identifiers (in the form of SHA-1 hash) can be linked to the repository viewer.

This variable is an array of (key, value) pairs, the key is used to look up the git remote entry URL. The key is a pattern passed to preg_match and preg_replace, without the delimiters (which are #) and must match the whole URL.

The value is a pattern to obtain a correct URL for the gitweb interface. The value is the regular expression replacement for the key (it can contain $1, etc.). %h will be replaced by the short SHA-1 (7 first chars) and %H by the full SHA-1 of the HEAD revision.

Example
If you have the following entry in .ssh/config (as described in gerrit-adv>Special:MyLanguage/Gerrit/Advanced usage#Setup_SSH_shortcut_.28optional.29|Setup SSH shortcut):

And if your git remote used to fetch MediaWiki is configured in the following way in .git/config:

then this entry in localsettings>Special:MyLanguage/LocalSettings.php|LocalSettings.php will make  URL to be recognized as pointing to the git>Special:MyLanguage/Git|Wikimedia git repository:

GitHub
When using extensions that are maintained at GitHub, you can use this to link them.