2.5 KiB
+++ title = "1.17 breaking changes episode 1: preserving a custom gitconfig" date = 2022-06-22 description = "The location of the gitconfig file used by Gitea moved and custom modifications must be manually moved as well." [taxonomies] tags = ['gna', 'gitea', 'troubleshoot', 'problem', 'tutorial']
[extra] author = 'dachary' +++
Before version 1.17, when Gitea needed to change the git configuration, it modified the $HOME/.gitconfig
file. For instance it would set core.quotePath to false:
[core]
quotePath = false
When installing Gitea from docker or rootless or even from binary this $HOME/.gitconfig
file belongs to a user that is dedicated to Gitea and not used by anyone else.
However, if an Gitea installation was done differently and $HOME/.gitconfig
has been customized because it is shared by a user or another application, there is a good chance that manual modifications were done such as:
[user]
name = Jane Doe
email = jane@doe.com
It is also possible that the file was modified manually by the Gitea admin for other reasons. In both there is a potential for breakage when upgrading to Gitea >= 1.17 because the location of the file changed. It must be moved manually to the new location as follows:
- Figure out the directory where
$HOME/.gitconfig
must be moved by running the doctor:
$ gitea --work-path /app/gitea -c /data/gitea/conf/app.ini doctor
[1] Check paths and basic configuration
- [I] Configuration File Path: "/data/gitea/conf/app.ini"
- [I] Repository Root Path: "/data/git/repositories"
- [I] Data Root Path: "/data/gitea"
- [I] Custom File Root Path: "/data/gitea"
- [I] Work directory: "/app/gitea"
- [I] Log Root Path: "/data/gitea/log"
OK
- Copy the
$HOME/.gitconfig
file to the Repository Root Path (which is/data/git/repositories
in the example above).
The reason why this breaking change was introduced is to workaround a rare problem impacting Gitea installations relying on networked volumes.