外观
get_local_git_repo_info
约 130 字小于 1 分钟
2025-08-01
@candriajs/git-neko-kit / get_local_git_repo_info
函数: get_local_git_repo_info()
get_local_git_repo_info(
local_path
):Promise
<null
|GitRepoInfoType
>
定义于: common/git.ts:72
获取本地 Git 仓库信息
参数
local_path
string
本地仓库路径
返回
Promise
<null
| GitRepoInfoType
>
Git 仓库信息
Description
获取本地 Git 仓库信息,返回仓库名称、仓库路径、仓库地址等信息
示例
const info = await get_local_git_repo_info('D:/project/repo')
console.log(info)
-> {
name: 'repo',
path: 'D:/project/repo',
url: 'https://github.com/owner/repo.git',
html_url: 'https://github.com/owner/repo',
owner: 'owner',
repo: 'repo'
}