Use JGit to rename the repository

时间:2017-10-12 09:53:59

标签: rename jgit

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

  • Create a Git repository.
  • Delete a Git repository.
  • Rename a Git repository.

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?

1 个答案:

答案 0 :(得分:1)

Git存储库本身没有名称,因此JGit不提供重命名API。

通常,存储库所在的最后一段用于在必要时为其命名。例如,/foo/bar/.git中的存储库将被命名为bar

要重命名存储库,只需move its location by using the Java file API