.gitignore for Bitrix
9 ignore rules for Bitrix, ready to copy into your repository.
Russian CMS and web framework
The complete .gitignore for Bitrix
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:10 UTC
# Technologies: Bitrix
### Bitrix ###
/bitrix/*
!/bitrix/templates
!/bitrix/components
/bitrix/components/bitrix
!/bitrix/gadgets
/bitrix/gadgets/bitrix
!/bitrix/php_interface/
/bitrix/php_interface/dbconn.php
/upload/
What these Bitrix rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Exclude all of core files
| Pattern | What it ignores |
|---|---|
/bitrix/* |
Exclude all of core files |
But not the templates and non bitrix components
| Pattern | What it ignores |
|---|---|
!/bitrix/templates |
But not the templates and non bitrix components |
!/bitrix/components |
But not the templates and non bitrix components |
/bitrix/components/bitrix |
But not the templates and non bitrix components |
Exclude bitrix gadgets
| Pattern | What it ignores |
|---|---|
!/bitrix/gadgets |
Exclude bitrix gadgets |
/bitrix/gadgets/bitrix |
Exclude bitrix gadgets |
User can use that directory to store some stuff, but it's not really recommended, just use /local in
| Pattern | What it ignores |
|---|---|
!/bitrix/php_interface/ |
User can use that directory to store some stuff, but it's not really recommended, just use /local in |
Exclude database configs
| Pattern | What it ignores |
|---|---|
/bitrix/php_interface/dbconn.php |
Exclude database configs |
Exclude default file storage directory
| Pattern | What it ignores |
|---|---|
/upload/ |
Exclude default file storage directory |
How to use this .gitignore for Bitrix
- Copy the Bitrix rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.