Hi
I am using HTTPS rest API to push:
curl -i -X PUT -u user:pass -F sourceCommitId=12345 -Fcontent=@file.txt -F branch=master…etc
How can I define different committer/author for this commit?
Thanx in advance
Noam
Hi
I am using HTTPS rest API to push:
curl -i -X PUT -u user:pass -F sourceCommitId=12345 -Fcontent=@file.txt -F branch=master…etc
How can I define different committer/author for this commit?
Thanx in advance
Noam
Welcome to the Atlassian developer community @noamgershi,
The great thing about Atlassian is that we have so many APIs to choose from! For your case, I can’t tell which one you are talking about. Maybe Bitbucket because of the reference to committer? But still, there are different auth mechanisms across Bitbucket Server/Data Center vs Bitbucket Cloud.
Maybe you could have a look at the following to see if it helps prompt for more context so that we can help:
thanx for the reply.
I am following: From Java do PUT in BitBucket
So I am using bitbucket and https rest api version 1.0. and I want to define the committer and the author so they will be different.
That means you are using the “PUT
/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}” endpoint of the “browse” REST endpoint for Bitbucket Data Center (documentation here).
I took a quick look at the server-side source code for this REST endpoint (com/atlassian/stash/internal/rest/content/ContentResource.java) and based on what I saw looks like GIT_COMMITTER and GIT_AUTHOR will always be set to the current authenticated user when using this REST endpoint. As of Bitbucket v8.15.x there is no ability to change them through this REST endpoint - at least none that I could see.
@sylvie Hey sorry to reply on a old post, but i am facing an issue and i found this thread to be closest one.
I am using same api , PUT /api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path} to perform a commit with API. But I am getting below error
Bitbucket: ‘pbord3’ != Commit: ‘SecondName, firstName’
Committer name in your git user.name is not matching with bitbucket user slug. Please make sure you have mentioned correct network id under your git user.name
My .gitconfig file in local has user name as - ‘pbord3’ , and it matches with bitbucket user slug which is also ‘pbord3’.
on file commits , my name is shown as ‘SecondName, FirstName’
I am not sure what to change and where to look at? kind of stuck at this place. Any support here would be really helpful