### Get Staging Area (HTTP GET)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves the current staging area, showing modified, added, and deleted files. Requires repository key and authentication. The response is in XML format.
```http
GET /sap/bc/adt/abapgit/repos/{key}/stage
Accept: application/abapgit.adt.repo.stage.v1+xml
Username: github_user
Password: [base64_encoded_password]
HTTP/1.1 200 OK
Content-Type: application/abapgit.adt.repo.stage.v1+xml
ZCL_EXAMPLECLAS/sap/bc/adt/oo/classes/zcl_exampleCLASzcl_example.clas.abap/src/MJohn Doejohn.doe@example.comJohn Doejohn.doe@example.com
```
--------------------------------
### List Repositories GET Request
Source: https://context7.com/abapgit/adt_backend/llms.txt
Use this endpoint to retrieve a list of all Git repositories linked to the SAP system. Requires the 'application/abapgit.adt.repos.v2+xml' Accept header.
```http
GET /sap/bc/adt/abapgit/repos
Accept: application/abapgit.adt.repos.v2+xml
```
```xml
000001https://github.com/org/repo.gitZPACKAGErefs/heads/mainfalse
```
--------------------------------
### Get File Content (HTTP GET)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves the content of a specific file from either the local or remote version. Requires repository key, filename, and version parameter ('local' or 'remote'). Returns plain text content.
```http
GET /sap/bc/adt/abapgit/repos/{key}/files?filename=zcl_example.clas.abap&version=local
Username: github_user
Password: [base64_encoded_password]
HTTP/1.1 200 OK
Content-Type: text/plain
CLASS zcl_example DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
" ... class implementation
ENDCLASS.
```
--------------------------------
### Get External Repository Info
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves information about an external Git repository.
```APIDOC
## POST /sap/bc/adt/abapgit/externalrepoinfo
### Description
Retrieves information about an external Git repository including access mode (public/private) and available branches.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/externalrepoinfo
### Request Headers
- **Content-Type**: application/abapgit.adt.repo.info.ext.request.v2+xml
- **Accept**: application/abapgit.adt.repo.info.ext.response.v2+xml
### Request Body
```xml
https://github.com/org/repo.gitgithub_usergithub_token
```
### Response
#### Success Response (200)
- **Content-Type**: application/abapgit.adt.repo.info.ext.response.v2+xml
### Response Example
```xml
PUBLICrefs/heads/mainabc123def456...truerefs/heads/develop789ghi012jkl...false
```
```
--------------------------------
### Get File Content
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves the content of a specific file from either the local or remote version.
```APIDOC
## GET /sap/bc/adt/abapgit/repos/{key}/files
### Description
Retrieves the content of a specific file from either the local or remote version.
### Method
GET
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/files
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
#### Query Parameters
- **filename** (string) - Required - The name of the file to retrieve.
- **version** (string) - Required - Specifies whether to retrieve the 'local' or 'remote' version of the file.
#### Headers
- **Username**: github_user
- **Password**: [base64_encoded_password]
### Response
#### Success Response (200)
- **Content-Type**: text/plain
- The response body contains the content of the requested file.
#### Response Example
```
CLASS zcl_example DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
" ... class implementation
ENDCLASS.
```
```
--------------------------------
### Get External Repository Info POST Request
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves information about an external Git repository, such as access mode and available branches. Requires authentication details if the repository is private. The request content type is 'application/abapgit.adt.repo.info.ext.request.v2+xml'.
```http
POST /sap/bc/adt/abapgit/externalrepoinfo
Content-Type: application/abapgit.adt.repo.info.ext.request.v2+xml
Accept: application/abapgit.adt.repo.info.ext.response.v2+xml
```
```xml
https://github.com/org/repo.gitgithub_usergithub_token
```
```xml
PUBLICrefs/heads/mainabc123def456...truerefs/heads/develop789ghi012jkl...false
```
--------------------------------
### Get Staging Area
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves the current staging area showing modified, added, and deleted files ready for commit.
```APIDOC
## GET /sap/bc/adt/abapgit/repos/{key}/stage
### Description
Retrieves the current staging area showing modified, added, and deleted files ready for commit.
### Method
GET
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/stage
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
#### Headers
- **Accept**: application/abapgit.adt.repo.stage.v1+xml
- **Username**: github_user
- **Password**: [base64_encoded_password]
### Response
#### Success Response (200)
- **ABAPGITSTAGING** (object) - Represents the staging area.
- **unstaged_objects** (array) - List of unstaged objects.
- **item** (object) - Details of an unstaged object.
- **object_ref** (object) - Reference to the ABAP object.
- **name** (string) - The name of the object.
- **type** (string) - The type of the object.
- **uri** (string) - The URI of the object.
- **wbkey** (string) - Workbench key of the object.
- **files** (array) - List of files associated with the object.
- **item** (object) - Details of a file.
- **filename** (string) - The name of the file.
- **path** (string) - The path of the file within the repository.
- **localstate** (string) - The local state of the file (e.g., M for Modified).
- **remotestate** (string) - The remote state of the file.
- **atom_links** (array) - Atom links for fetching file versions.
- **staged_objects** (array) - List of staged objects (empty in this example).
- **ignored_objects** (array) - List of ignored objects.
- **abapgit_comment** (object) - Comment information.
- **author** (object) - Author details.
- **name** (string) - Author's name.
- **email** (string) - Author's email.
- **committer** (object) - Committer details.
- **name** (string) - Committer's name.
- **email** (string) - Committer's email.
#### Response Example
```xml
ZCL_EXAMPLECLAS/sap/bc/adt/oo/classes/zcl_exampleCLASzcl_example.clas.abap/src/MJohn Doejohn.doe@example.comJohn Doejohn.doe@example.com
```
```
--------------------------------
### Switch Branch (HTTP POST)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Switches the repository to a different branch. Optionally creates the branch if it doesn't exist by setting the 'create' query parameter to 'true'. Requires repository key and branch name.
```http
POST /sap/bc/adt/abapgit/repos/{key}/branches/{branch_name}?create=true
Username: github_user
Password: [base64_encoded_password]
HTTP/1.1 200 OK
```
--------------------------------
### List Repositories
Source: https://context7.com/abapgit/adt_backend/llms.txt
Retrieves a list of all Git repositories linked to the SAP system.
```APIDOC
## GET /sap/bc/adt/abapgit/repos
### Description
Returns a list of all online Git repositories linked to the SAP system.
### Method
GET
### Endpoint
/sap/bc/adt/abapgit/repos
### Request Headers
- **Accept**: application/abapgit.adt.repos.v2+xml
### Response
#### Success Response (200)
- **Content-Type**: application/abapgit.adt.repos.v2+xml
### Response Example
```xml
000001https://github.com/org/repo.gitZPACKAGErefs/heads/mainfalse
```
```
--------------------------------
### Check Repository Connection (HTTP POST)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Validates the connection to the Git server and checks authentication credentials. Returns HTTP 200 on success, or an error code (e.g., 500 with http_status) on failure.
```http
POST /sap/bc/adt/abapgit/repos/{key}/checks
Username: github_user
Password: [base64_encoded_password]
HTTP/1.1 200 OK
HTTP/1.1 500 Internal Server Error
```
--------------------------------
### Clone Multiple Repositories POST Request (v4)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Links multiple Git repositories in a single request. The request content type is 'application/abapgit.adt.repo.v4+xml'. The response indicates success with a 201 Created status.
```http
POST /sap/bc/adt/abapgit/repos
Content-Type: application/abapgit.adt.repo.v4+xml
Accept: application/abapgit.adt.repo.object.v2+xml
```
```xml
https://github.com/org/repo1.gitrefs/heads/mainZPACKAGE1DEVK900123https://github.com/org/repo2.gitrefs/heads/mainZPACKAGE2DEVK900123
```
--------------------------------
### Clone/Link Repository (v1 - Single Repository)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Links a Git repository to an ABAP package by importing it into the SAP system.
```APIDOC
## POST /sap/bc/adt/abapgit/repos (v1)
### Description
Links a Git repository to an ABAP package by importing it into the SAP system.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos
### Request Headers
- **Content-Type**: application/abapgit.adt.repo.v3+xml
- **Accept**: application/abapgit.adt.repo.object.v2+xml
### Request Body
```xml
https://github.com/org/repo.gitrefs/heads/mainZPACKAGEDEVK900123github_usergithub_token
```
### Response
#### Success Response (200)
- **Content-Type**: application/abapgit.adt.repo.object.v2+xml
### Response Example
```xml
CLASZCL_EXAMPLESZPACKAGESObject imported successfully
```
```
--------------------------------
### Clone/Link Single Repository POST Request (v3)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Links a Git repository to an ABAP package by importing it. Specify the repository URL, branch, package, and optionally a transport request, user, and password. The request content type is 'application/abapgit.adt.repo.v3+xml'.
```http
POST /sap/bc/adt/abapgit/repos
Content-Type: application/abapgit.adt.repo.v3+xml
Accept: application/abapgit.adt.repo.object.v2+xml
```
```xml
https://github.com/org/repo.gitrefs/heads/mainZPACKAGEDEVK900123github_usergithub_token
```
```xml
CLASZCL_EXAMPLESZPACKAGESObject imported successfully
```
--------------------------------
### Check Repository Connection
Source: https://context7.com/abapgit/adt_backend/llms.txt
Validates the connection to the Git server and checks authentication credentials.
```APIDOC
## POST /sap/bc/adt/abapgit/repos/{key}/checks
### Description
Validates the connection to the Git server and checks authentication credentials.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/checks
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
#### Headers
- **Username**: github_user
- **Password**: [base64_encoded_password]
### Response
#### Success Response (200)
- An empty response with a 200 OK status indicates a successful connection and valid credentials.
#### Error Response (500)
- **HTTP/1.1 500 Internal Server Error**: Indicates an issue with the connection or authentication.
- The response body may contain a `http_status` property indicating the specific authentication failure (e.g., 401, 403, 404).
```
--------------------------------
### Clone/Link Repositories (v2 - Multiple Repositories)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Links multiple Git repositories in a single request.
```APIDOC
## POST /sap/bc/adt/abapgit/repos (v2)
### Description
Links multiple Git repositories in a single request.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos
### Request Headers
- **Content-Type**: application/abapgit.adt.repo.v4+xml
- **Accept**: application/abapgit.adt.repo.object.v2+xml
### Request Body
```xml
https://github.com/org/repo1.gitrefs/heads/mainZPACKAGE1DEVK900123https://github.com/org/repo2.gitrefs/heads/mainZPACKAGE2DEVK900123
```
### Response
#### Success Response (201)
- **Status Code**: 201 Created
```
--------------------------------
### Switch Branch
Source: https://context7.com/abapgit/adt_backend/llms.txt
Switches the repository to a different branch, optionally creating it if it doesn't exist.
```APIDOC
## POST /sap/bc/adt/abapgit/repos/{key}/branches/{branch_name}
### Description
Switches the repository to a different branch, optionally creating it if it doesn't exist.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/branches/{branch_name}
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
- **branch_name** (string) - Required - The name of the branch to switch to.
#### Query Parameters
- **create** (boolean) - Optional - If set to `true`, the branch will be created if it does not exist.
#### Headers
- **Username**: github_user
- **Password**: [base64_encoded_password]
### Response
#### Success Response (200)
- An empty response with a 200 OK status indicates the branch switch was successful.
```
--------------------------------
### Manage Git Authentication Credentials
Source: https://context7.com/abapgit/adt_backend/llms.txt
Use this helper class to set, retrieve, and clear Git authentication credentials before and after API operations. Ensure credentials are cleared after use.
```abap
" Set authentication credentials before Git operations
zcl_abapgit_default_auth_info=>set_auth_info(
iv_user = 'github_user'
iv_password = 'github_personal_access_token' ).
" Retrieve stored credentials
DATA(lv_user) = zcl_abapgit_default_auth_info=>get_user( ).
DATA(lv_password) = zcl_abapgit_default_auth_info=>get_passoword( ).
" Clear credentials after operation
zcl_abapgit_default_auth_info=>refresh( ).
```
--------------------------------
### Push Changes (Commit) (HTTP POST)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Pushes staged changes to the remote Git repository with a commit message. Requires repository key, staging information, and authentication. The response indicates success.
```http
POST /sap/bc/adt/abapgit/repos/{key}/push
Content-Type: application/abapgit.adt.repo.stage.v1+xml
Username: github_user
Password: [base64_encoded_password]
ZCL_EXAMPLECLASzcl_example.clas.abap/src/Mfeat: Add new feature implementationJohn Doejohn.doe@example.comJohn Doejohn.doe@example.com
HTTP/1.1 200 OK
```
--------------------------------
### Pull Repository
Source: https://context7.com/abapgit/adt_backend/llms.txt
Pulls the latest changes from the remote Git repository and deserializes them into ABAP objects.
```APIDOC
## POST /sap/bc/adt/abapgit/repos/{key}/pull
### Description
Pulls the latest changes from the remote Git repository and deserializes them into ABAP objects.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/pull
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
#### Request Body
- **REPOSITORY** (object) - Required - Contains details for the pull operation.
- **branch** (string) - Required - The branch to pull from (e.g., refs/heads/main).
- **transportrequest** (string) - Optional - The transport request to associate with the pull.
- **user** (string) - Required - The username for authentication.
- **password** (string) - Required - The password or token for authentication.
### Request Example
```xml
refs/heads/mainDEVK900123github_usergithub_token
```
### Response
#### Success Response (200)
- **OBJECTS** (object) - Contains a list of updated objects.
- **item** (array) - List of objects.
- **obj_type** (string) - The type of the ABAP object.
- **obj_name** (string) - The name of the ABAP object.
- **obj_status** (string) - The status of the object update (e.g., S for success).
- **package** (string) - The package the object belongs to.
- **msg_type** (string) - The message type (e.g., S for success).
- **msg_text** (string) - A message describing the result.
#### Response Example
```xml
CLASZCL_UPDATED_CLASSSZPACKAGESObject updated successfully
```
```
--------------------------------
### Pull Repository Changes (HTTP POST)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Pulls the latest changes from the remote Git repository. Requires repository key, branch, and authentication details. Returns a list of updated objects.
```http
POST /sap/bc/adt/abapgit/repos/{key}/pull
Content-Type: application/abapgit.adt.repo.v3+xml
Accept: application/abapgit.adt.repo.object.v2+xml
refs/heads/mainDEVK900123github_usergithub_token
HTTP/1.1 200 OK
Content-Type: application/abapgit.adt.repo.object.v2+xml
CLASZCL_UPDATED_CLASSSZPACKAGESObject updated successfully
```
--------------------------------
### Push Changes (Commit)
Source: https://context7.com/abapgit/adt_backend/llms.txt
Pushes staged changes to the remote Git repository with a commit message.
```APIDOC
## POST /sap/bc/abapgit/repos/{key}/push
### Description
Pushes staged changes to the remote Git repository with a commit message.
### Method
POST
### Endpoint
/sap/bc/adt/abapgit/repos/{key}/push
### Parameters
#### Path Parameters
- **key** (string) - Required - The unique identifier for the repository.
#### Headers
- **Content-Type**: application/abapgit.adt.repo.stage.v1+xml
- **Username**: github_user
- **Password**: [base64_encoded_password]
#### Request Body
- **ABAPGITSTAGING** (object) - Contains the staged objects and commit information.
- **staged_objects** (array) - List of objects to be committed.
- **item** (object) - Details of a staged object.
- **object_ref** (object) - Reference to the ABAP object.
- **name** (string) - The name of the object.
- **type** (string) - The type of the object.
- **files** (array) - List of files associated with the object.
- **item** (object) - Details of a file.
- **filename** (string) - The name of the file.
- **path** (string) - The path of the file within the repository.
- **localstate** (string) - The local state of the file (e.g., M for Modified).
- **abapgit_comment** (object) - Commit message and author details.
- **comment** (string) - The commit message.
- **author** (object) - Author details.
- **name** (string) - Author's name.
- **email** (string) - Author's email.
- **committer** (object) - Committer details.
- **name** (string) - Committer's name.
- **email** (string) - Committer's email.
### Request Example
```xml
ZCL_EXAMPLECLASzcl_example.clas.abap/src/Mfeat: Add new feature implementationJohn Doejohn.doe@example.comJohn Doejohn.doe@example.com
```
### Response
#### Success Response (200)
- The response body is empty upon successful push.
```
--------------------------------
### Delete Repository Link
Source: https://context7.com/abapgit/adt_backend/llms.txt
Removes the link between a Git repository and the SAP system.
```APIDOC
## DELETE /sap/bc/adt/abapgit/repos/{key}
### Description
Removes the link between a Git repository and the SAP system (does not delete ABAP objects).
### Method
DELETE
### Endpoint
/sap/bc/adt/abapgit/repos/{key}
### Path Parameters
- **key** (string) - Required - The unique identifier of the repository link to delete.
### Response
#### Success Response (200)
- **Status Code**: 200 OK
```
--------------------------------
### Delete Repository Link DELETE Request
Source: https://context7.com/abapgit/adt_backend/llms.txt
Removes the link between a Git repository and the SAP system. This operation does not delete ABAP objects. The repository key must be provided in the URL.
```http
DELETE /sap/bc/adt/abapgit/repos/{key}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.