3.3. Cloning a Repository
It is possible to clone a repository either in Business Central or using the REST API calls. The kie-config-cli tool cannot be used to clone arbitrary repositories - run git clone or use one of the following options instead.
Cloning a Repository in Business Central
Note that only users with the admin role in Business Central can clone repositories.
Procedure: Using Business Central to Clone a Repository
- In Business Central, go to Authoring → Administration.
On the perspective menu, choose Repositories → Clone repository.
The Clone Repository pop-up window is displayed.
Figure 3.3. *Clone Repository*Dialog Window

In the Clone Repository dialog window, enter the repository details:
- Enter the Repository Name to be used as the repository identifier in the Asset repository and select the Organizational Unit it should be added to.
Enter the URL of the Git repository:
for a local repository, use
file:///PATH_TO_REPOSITORY/REPOSITORY_NAME;NoteThe file protocol is only supported for READ operations. WRITE operations are not supported.
for a remote or preexisting repository, use
https://github.com/USERNAME/REPOSITORY_NAME.gitorgit://HOST_NAME/REPOSITORY_NAME.ImportantIt is important to use the HTTPS or Git protocol instead of a SCP-style SSH URL. Business Central does not support the basic SSH URL and fails with Invalid URL format.
- If applicable, enter the User Name and Password of your Git account to be used for authentication.
Click Clone.
A confirmation prompt with the notification that the repository was created successfully is displayed.
Click Ok.
The repository is now being indexed. Some workbench features may be unavailable until the indexing has completed.
You can view the cloned repository either in the File Explorer or the Project Explorer.
Cloning a Repository Using the REST API
Note that only users with the rest-all role can clone repositories.
To clone a repository, issue the POST REST API call. This call creates or clones (according to the value of the requestType parameter) the repository defined by the JSON entity.
Input parameter of the call is a RepositoryRequest instance. The call returns a CreateOrCloneRepositoryRequest instance.
Example 3.3. Cloning a Repository Using the Curl Utility
Example JSON entity containing details of a repository to be cloned:
{
"name" : "clonedRepository",
"description" : null,
"requestType" : "clone",
"gitURL" : "git://localhost:9418/newRepository",
"organizationalUnitName" : "helloWorldUnit"
}Execute the following command:
curl -X POST 'localhost:8080/business-central/rest/repositories/' -u USERNAME:PASSWORD -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"name":"clonedRepository","description":null,"requestType":"clone","gitURL":"git://localhost:9418/newRepository","organizationalUnitName":"helloWorldUnit"}'For further information, see the Red Hat JBoss BPM Suite Development Guide, chapter Knowledge Store REST API, section Repository Calls.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.