'Bitbucket server REST API: Does commit API overwrite the file or will it ever have conflicts (does a merge)

I am using /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*} to push commit to a file using Bitbucket.

I am able to do that successfully with branch, content, sourceCommitId , etc as parameters.

My question is : Do I need to worry about conflicts when using this API ? The error messages returned are about file not being present, contents not changed, etc but will there ever be a scenario where despite giving the last commit ID (in soureCommitId) , there will be conflicts ?

Does Bitbucket overwrite the file blindly ? (that would work for me)

Thanks!



Solution 1:[1]

Yes, BB will overwrite the file.

You can pass branch name instead the commit. This will update the tip of branch.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MFabricanti