exclude Command
Remove git-tracked files matching exclude configuration from git tracking.
ABAP objects are never touched — only git tracking is affected.
Command
abapgit-agent exclude
What It Does
- Reads
excludeconfig (patternsand/orunsupportedTypes) from.abapgit-agent.json - Runs
git ls-filesto list all tracked files - Filters files matching any of the glob patterns
- Runs
git rm --cachedto untrack matching files - Commits the removal with message:
chore: exclude ABAP objects per .abapgit-agent.json
The files remain on disk and in the ABAP system — only their git tracking is removed.
When to Use
Use this command after configuring exclude in .abapgit-agent.json to clean up files
that were previously tracked but should no longer be:
unsupportedTypes: true— catch-all afterimport: removes BADI, W3MI, XSLT, WDYN, and any other types abapGit cannot pull or activatepatterns— target specific supported-type files by name pattern (e.g. SEGW-generated DPC/MPC classes that cause activation failures)
Configuration
Add an exclude section to .abapgit-agent.json:
{
"exclude": {
"unsupportedTypes": true,
"patterns": [
"zcl_*_dpc*.clas.*",
"zcl_*_mpc*.clas.*",
"src/aud_legacy/**"
]
}
}
The first two are basename patterns (no /) — they match SEGW-generated
DPC/MPC classes anywhere in the repo. The third is a path pattern — it
excludes every file under src/aud_legacy/.
unsupportedTypes: true — automatically excludes any file whose object type (the middle
dot-segment of the filename, e.g. badi in zfoo.badi.xml) is not in the set of types
supported by abapgit-agent: CLAS, INTF, PROG, FUGR, TABL, DTEL, TTYP, DOMA, DDLS, DCLS,
MSAG, STRU, ENHO, SUSO, PINF. Use this after import to remove all types abapGit cannot activate.
patterns — explicit glob patterns. Two styles, distinguished by whether the
pattern contains a forward slash:
- Without
/— basename match. Matched against the file’s basename (directory stripped). Examples:zcl_*_dpc*.clas.* # SEGW-generated data-provider classes cl_temp_*.clas.* # any "temp" class anywhere in the repo - With
/— full-path match. Matched against the full relative path. Use**for cross-segment matching. Examples:src/aud_legacy/** # exclude a whole folder/package src/aud_*/cl_temp_*.clas.* # wildcards in the directory portion src/aud_legacy/**/*.clas.* # only CLAS files under a folder
Matching is case-insensitive.
Path-based patterns and
import: the ABAP-side filter insideimportonly sees file basenames. Path patterns (those containing/) are silently skipped duringimportand a warning is printed. They DO take effect forexcludeandpull --files. Runabapgit-agent excludeafterimportto prune the unwanted files from git.
Effect on Other Commands
Once patterns are configured:
pull— files matching exclude config are skipped with a warningimport— excluded files are filtered before staging/committing to git
Example
# Configure exclusions in .abapgit-agent.json, then run:
abapgit-agent exclude
# Output:
# Checking exclude patterns from .abapgit-agent.json...
# Found 2 pattern(s): zcl_*_dpc*.clas.*, zcl_*_mpc*.clas.*
#
# Files to remove from git:
# abap/zcl_zsegw_dpc.clas.abap
# abap/zcl_zsegw_dpc.clas.xml
# abap/zcl_zsegw_mpc.clas.abap
#
# ✅ Removed 3 file(s) from git. ABAP objects remain untouched.
# Committed as: chore: exclude ABAP objects per .abapgit-agent.json
Prerequisite
- Current folder is a git repository
.abapgit-agent.jsonexists withexclude.patternsand/orexclude.unsupportedTypes: true