ThiepNQ
ThiepNQ

Reputation: 43

Use JGit to rename the repository

I'm developing a tool that has 3 functions as follows:

I must use JGit to implement this tool. But I did not find a way to rename of the repository by using JGit.

Does anyone know how to use JGit to rename the repository?

Upvotes: 2

Views: 140

Answers (1)

Rüdiger Herrmann
Rüdiger Herrmann

Reputation: 20985

A Git repository does not have a name in itself, hence JGit does not provide an API for renaming.

Usually the last segment of the directly in which the repository is located is used to name it when necessary. For example a repository in /foo/bar/.git will be named bar.

In order to rename a repository, simply move its location by using the Java file API.

Upvotes: 1

Related Questions