Editing the Git Configuration .gitconfig With Custom Settings - GitLab Omnibus

I’d like to add the following to the .gitconfig file within the /var/opt/gitlab/.gitconfig file:

        name = GitLab
        email =
        autocrlf = input
        packedGitLimit = 1024m
        packedGitWindowSize = 1024m
        bigFileThreshold = 256m

        deltaCacheSize = 512m
        windowMemory   = 1024m

Is it possible to do this? If I edit the file manually, it says to change the settings in the “/etc/gitlab/gitlab.rb” file instead. However, this file can’t be structured that way.

According to this: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eae0942ec27ffeec534ba02e4171a3b6cd6d193/files/gitlab-config-template/gitlab.rb.template#L378

Will adding this line do what I wanted to above?

omnibus_gitconfig['system'] = { "core" => ["autocrlf = input", "packedGitLimit = 1024m", "packedGitWindowSize = 1024m", "bigFileThreshold = 256m"], "pack" => ["deltaCacheSize = 512m", "windowMemory = 1024m"] }

When I run sudo gitlab-ctl reconfigure the .gitconfig file has not changed to reflect the settings I put in above? What’s the right way to do this?

omnibus_gitconfig['system'] option modifies system git config file (not user git config file). Gitlab system config file can be found at /opt/gitlab/embedded/etc/gitconfig

The git user .gitconfig file appears to be generated from the template file at:


The default content of that file in my version of GitLab is as follows:

# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.

        name = <%= node['gitlab']['user']['git_user_name'] %>
        email = <%= node['gitlab']['user']['git_user_email'] %>
        autocrlf = input

The simplest thing would appear to be to append your additional settings to this file.