我在从 stash 分支获取 HEAD
提交时遇到了一些问题。我可以使用以下 REST 调用获取分支提交。
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits?until={branch Name}
我还可以使用 /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/HEAD
在 master 中获取 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
但是当引用类似 feature/JIRA-123-foo-bar
的分支时,这会失败。
或者你可以调用
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches
这将为您提供所有分支及其最新提交。参见 Stash API documentation更多
关于git - 如何使用 stash rest api 获取分支头提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35598976/