I use the stash as our SCM.
I want to get the commits in a specific branch.
I go through the REST API for stash.
My steps are: logon to stash --> get all of the branched for a specific repository ordered by Last modified --> take the branch name --> set the branch as the default branch --> get the commits in this branch.
But "set the branch as the default branch" this action is very dangerous.
I think if there were any other solution to get the commits in a specific branch in stash via REST API?
I think what you want is the "compare" REST endpoint, with which can get you commits, changes or a diff, between a from & to ref (eg. "master") or commit hash. For example:
https://stash.example.com/rest/api/1.0/projects/PROJECT/repos/myrepo/compare/commits?from=my-branch&to=master
Thanks, Marcin, this solution is just what I want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what about excluding merge?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.