gih*_*han 2 git bitbucket-server
我HEAD从存储分支获取提交时遇到问题。我可以使用以下REST调用获取分支提交。
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits?until={branch Name}
Run Code Online (Sandbox Code Playgroud)
我也可以使用 /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/HEAD
像明智的那样,我想知道我如何使用Stash REST API获得分支HEAD提交。
对于没有正斜杠的分支名称,下面的方法非常适合:
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/develop
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/master
Run Code Online (Sandbox Code Playgroud)
但这在引用feature/JIRA-123-foo-bar类分支时失败。
或者,您可以调用
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches
Run Code Online (Sandbox Code Playgroud)
这将为您提供所有分支机构及其最新提交。有关更多信息,请参见Stash API文档