I am trying to write some scripts which will create files(json) in Bitbucket Server and occasionally update these files. Later on I would like to be able to query the changes made to the files and what was added/removed.
For now i have been testing with the CURL examples on the API documentation provided by the product vendor. I have been able to create a new file, however i notice to update this file, you need to specify the sourceCommitId.
My question is, how do I get this sourceCommitId, if I don't know it and just know the file name?
How do I achieve this?
If I look at the documentation, there is an option to specify path, however if i put the file path from bitbucket it returns nothing.
e.g. GET /rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits?path="filepath"