By default, the settings are stored in the
.teamcity in the root of the repository. If you wish to change the path used by TeamCity, you can create a special VCS Root dedicated to the VCS settings storage, and specify the path as you want there.
Note that if settings are changed via user interface a commit in VCS will be performed on behalf of the user specified in VCS root. However commit message will also contain username of the TeamCity user who made UI change.
For example, in case with Perforce TeamCity will use the