Instance wide .gitattributes languages #13023

Open
opened 2025-11-02 10:27:58 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Tinyblargon on GitHub (May 24, 2024).

Feature Description

Specify custom languages, instance wide in Gitea.

Currently we create .gitattributes files in all our repositories to keep track of unsupported languages.
As you can imaging this does not scale well and only gets more cumbersome with each new repository and added language.

Could it be made so you can add custom languages for a whole Gitea instance like we can on a per repository bases already using a .gitattributes file

#Ansible
main.yml linguist-language=Ansible
*.ansible.yml linguist-language=Ansible

#Docker
dockerfile linguist-language=Docker
.dockerignore linguist-language=Docker
docker-compose*.yml linguist-language=Docker
docker-compose*.yaml linguist-language=Docker

#NGINX
*.nginx.conf linguist-language=NGINX

Screenshots

image

Originally created by @Tinyblargon on GitHub (May 24, 2024). ### Feature Description Specify custom languages, instance wide in Gitea. Currently we create `.gitattributes` files in all our repositories to keep track of unsupported languages. As you can imaging this does not scale well and only gets more cumbersome with each new repository and added language. Could it be made so you can add custom languages for a whole Gitea instance like we can on a per repository bases already using a `.gitattributes` file ```.gitattributes #Ansible main.yml linguist-language=Ansible *.ansible.yml linguist-language=Ansible #Docker dockerfile linguist-language=Docker .dockerignore linguist-language=Docker docker-compose*.yml linguist-language=Docker docker-compose*.yaml linguist-language=Docker #NGINX *.nginx.conf linguist-language=NGINX ``` ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/76069640/6ca88af2-f234-4a99-8f75-78964227b37b)
GiteaMirror added the type/proposal label 2025-11-02 10:27:58 -06:00
Author
Owner

@silverwind commented on GitHub (May 27, 2024):

GitHub supports something similar with a .github repo per-org or user. I think we could support such special repos too:

  • user/.gitea for user-specific settings/files.
  • org/.gitea for org-specific settings/files.
  • .gitea/.gitea for instance-wide settings/files. This special org would need to be restricted to admin users, so no regular user can create it.
@silverwind commented on GitHub (May 27, 2024): GitHub supports something similar with a `.github` repo [per-org or user](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/customizing-your-organizations-profile). I think we could support such special repos too: - `user/.gitea` for user-specific settings/files. - `org/.gitea` for org-specific settings/files. - `.gitea/.gitea` for instance-wide settings/files. This special org would need to be restricted to admin users, so no regular user can create it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13023