import Command
Import existing ABAP objects from a package into an existing abapGit online repository.
Command
abapgit-agent import
abapgit-agent import --message "Your commit message"
abapgit-agent import --branch main
abapgit-agent import --branch feature/my-branch --message "Your commit message"
Prerequisites
- Repository already exists in ABAP (created via abapGit UI or
createcommand) - Package has objects to import
- GitHub credentials configured in
.abapGitAgent
Behavior
The import command runs asynchronously as a background job:
- ✅ No HTTP timeout - Works for large packages with thousands of objects
- ✅ Real-time progress - Shows progress bar with current stage
- ✅ Non-blocking - Returns job number immediately
- ✅ Auto-polling - Polls every 2 seconds until completion
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--branch |
No | Auto-detected from current git branch | Branch to push to |
--message |
No | feat: initial import from ABAP package <package> |
Commit message |
--help |
No | - | Show help |
Configuration
.abapGitAgent
Add GitHub credentials to .abapGitAgent:
{
"gitUsername": "<your-github-username>",
"gitPassword": "ghp_your_github_token"
}
Environment Variables
export GIT_USERNAME="<your-github-username>"
export GIT_PASSWORD="ghp_your_github_token"
GitHub Personal Access Token
- Create a PAT at:
- GitHub.com: https://github.com/settings/tokens
- Select scopes:
repo- Full control of private repositories- Or
public_repoif your repo is public
How It Works
The import command runs asynchronously using a background job with real-time progress updates:
- Start Background Job - Creates ABAP background job
- Poll for Status - Polls every 2 seconds for progress
- Display Progress - Shows progress bar with current stage
- Complete - Shows final results (files staged, time spent)
Import Stages
The background job progresses through 5 stages:
- Find Repository (10%) - Locate abapGit repository by git URL
- Refresh Repository (30%) - Get latest state from ABAP
- Stage Files (50-70%) - Create stage with all local files from package
- Prepare Commit (70%) - Build commit message and prepare metadata
- Push (90%) - Commit and push to remote repository
Workflow
Full Development Cycle
1. Develop in ABAP (SAP GUI, ADT)
└─> Create/modify objects in package
2. abapgit-agent import
└─> Stages, commits, and pushes to git
3. git pull (optional, in local repo)
└─> Get files to local folder
4. Repeat
Output
Success
📦 Starting import job
URL: https://github.com/user/repo.git
Branch: main
✅ Job started: 14334000
[==============================] Import completed successfully
✅ Import completed successfully!
Files staged: 3701
Commit: feat: initial import from ABAP package FRA_HOME_MAIN
⏱️ Time spent: 20 seconds
📈 Stats:
Job number: 14334000
Started: 2026-03-04 13:33:40
Completed: 2026-03-04 13:34:00
Progress Display
During import, a progress bar shows the current stage:
[=============== ] Staging local files...
[=========================== ] Pushing to repository...
[==============================] Import completed successfully
With Custom Message
📦 Starting import job
URL: https://github.com/user/repo.git
Branch: main
Message: My custom import message
✅ Job started: 14335000
[==============================] Import completed successfully
✅ Import completed successfully!
Files staged: 15
Commit: My custom import message
⏱️ Time spent: 8 seconds
📈 Stats:
Job number: 14335000
Started: 2026-03-04 14:20:10
Completed: 2026-03-04 14:20:18
Error - Repository Not Found
📦 Starting import job
URL: https://github.com/user/repo.git
Branch: main
✅ Job started: 14336000
[=============== ] Finding repository...
❌ Import failed!
Error: Repository not found
Error - No Objects Found
📦 Starting import job
URL: https://github.com/user/repo.git
Branch: main
✅ Job started: 14337000
[=========================== ] Staging local files...
❌ Import failed!
Error: No objects found in package
Error - GitHub Credentials
📦 Starting import job
URL: https://github.com/user/repo.git
Branch: main
✅ Job started: 14338000
[=========================== ] Pushing to repository...
❌ Import failed!
Error: Error during import (HTTP 403 Forbidden)
Troubleshooting
HTTP 401/403 Unauthorized
GitHub credentials not configured or invalid:
- Create a GitHub Personal Access Token
- Add to
.abapGitAgent:
{
"gitUsername": "<your-github-username>",
"gitPassword": "ghp_your_token"
}
Note: The password must be passed exactly as-is (case-sensitive). The import command preserves case sensitivity.
Repository Not Found
The repository must exist in abapGit:
- Run
abapgit-agent createto create it, OR - Create manually in abapGit: run transaction
ZABAPGIT(orSE38→ZABAPGIT) → New → Online → enter git URL
No Objects Found
The package may be empty or objects not yet created:
- Verify package in SAP GUI:
SE21→ Display Package - Ensure objects exist in the package
Job Stuck or Hangs
If the import appears to hang:
- Check ABAP background job:
SM37→ Job name:ABGAGT_IMPORT_* - View job log for errors
- If job failed, error will be shown in CLI after timeout
Large Package Import
For packages with thousands of objects:
- Import runs asynchronously (no HTTP timeout)
- Progress updates every 2 seconds
- Typical speed: ~100-200 objects per second
- 3700+ objects: ~20-30 seconds
Full Workflow
Option 1: abapgit-agent (Recommended)
# Initialize
abapgit-agent init --folder /abap --package ZMYPROJECT
# Edit config
vim .abapGitAgent
# Create repository
abapgit-agent create
# Develop objects in ABAP...
# Import objects to git
abapgit-agent import
# Pull to local folder
git pull origin main
Option 2: abapGit UI for Creation
# Initialize
abapgit-agent init --folder /abap --package ZMYPROJECT
# Edit config
vim .abapGitAgent
# Create repository in abapGit: run transaction ZABAPGIT → New → Online → Enter git URL
# Develop objects in ABAP...
# Import objects to git
abapgit-agent import
Related Commands
init- Initialize local configurationcreate- Create online repository in ABAPpull- Pull and activate objects in ABAP
Project-Level Safeguards
To disable the import command for all developers on a project, add to .abapgit-agent.json (checked into the repository). See Project Configuration reference for all available safeguards.
{
"safeguards": {
"disableImport": true,
"reason": "One-time operation — managed by release manager."
}
}
When disableImport: true:
- All
importcommands are blocked immediately with an error reasonis displayed if provided- Error message directs users to contact the project maintainer
Allow Specific Users to Bypass disableImport
Use importAllowedUsers to allow one or more SAP users to run import even when disableImport: true:
{
"safeguards": {
"disableImport": true,
"importAllowedUsers": ["ALICE", "JOHN"],
"reason": "Import is restricted to the release manager."
}
}
- Accepts a string (single user) or an array of strings
- User IDs are case-insensitive (matched against the
userfield in.abapGitAgent) - If the current user is in the list, the
disableImportblock is bypassed
Require a Commit Message
Use requireImportMessage to force developers to always supply --message:
{
"safeguards": {
"requireImportMessage": true,
"reason": "All imports must be traceable via commit message."
}
}
When requireImportMessage: true:
abapgit-agent import→ ❌ blocked, shows error and usage hintabapgit-agent import --message "Initial import"→ ✅ allowed
Safeguard Options Reference
| Option | Type | Default | Description |
|---|---|---|---|
disableImport |
boolean | false |
Completely disables the import command |
importAllowedUsers |
string | string[] | null |
Users who can bypass disableImport |
requireImportMessage |
boolean | false |
Forces --message to be provided |
reason |
string | null |
Optional explanation shown in error messages |