I need to set certain global git config options, however there is no option to set these in the gitea config. If I set them with git config --global as the user running gitea, will gitea retain these settings when using git?
As I understand it configuration settings you’re referring to are specific to the git cli tool itself and not Gitea specifically. Whereas the Gitea config file is used for app-specific settings. Git-specific config info with link to the “kitchen sink” available here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
I don’t know what are you looking for, but for some specific tasks you don’t need a global setting. For instance, a .gitattributes file in your repository drives the way line ends are handled (LF/CRLF/CR), whether files are treated as binary, diff is allowed, etc.
Part of what I want to to is guarantee that all newly created repositories that I host have the settings that I need. As long as I can create new repositories with the per-repository configuration settings in place, than I can get to where I need. What I want to do is have all newly created repositories hosted on my Gitea instance configured for a very low maximum pack-size. If there’s a better way to do this, either with a Gitea setting or some other way, I’d love to know about it. Thanks again for your help.
Gitea effectively launches git
behind the scenes for all the git operations, so I guess the answer to your question is yes, it will “retain” all the git config --global
configurations made within the environment set by Gitea’s launcher. You may however check how to pass the appropriate environment. In my system Gitea is launched as a service by systemd
; the environment variables are set by files in /etc/systemd/
and not by the git
user’s .profile
, .bashrc
, etc. I haven’t checked, but I guess at least $HOME
should be set properly for git to use.
lofidevops commented
I created a user for the Gitea process and modified
~/.gitconfig
for that user. Thanks!