Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Number of files pushed in a single commit

Gokul Rajan
Contributor
February 6, 2024

Hello Team,

I am trying to push multiple files into bitbucket cloud repository. When I try to add files more than 100 units, I am getting 400 Bad request.

curl -X POST --header "Authorization: Basic <Auth key>=" --header "Content-Type: multipart/form-data" --form "message=Commiting 1000 * 1MB files" --form "branch=main" --form "testFiles//file_100.txt=@"testFiles/file_100.txt";filename="file_100.txt"" --form "testFiles//file_10.txt=@"testFiles/file_10.txt";filename='file_10.txt'" --form "testFiles//file_11.txt=@"testFiles/file_11.txt";filename='file_11.txt'" --form "testFiles//file_12.txt=@"testFiles/file_12.txt";filename='file_12.txt'" --form "testFiles//file_13.txt=@"testFiles/file_13.txt";filename='file_13.txt'" 
...
...
--form "testFiles//file_98.txt=@"testFiles/file_98.txt";filename='file_98.txt'" --form "testFiles//file_99.txt=@"testFiles/file_99.txt";filename='file_99.txt'" --form "testFiles//file_9.txt=@"testFiles/file_9.txt";filename='file_9.txt'" "https://api.bitbucket.org/2.0/repositories/v-test/test/src"

Response: 
<!doctype html>

<html lang="en">

<head>

  <title>Bad Request (400)</title>

</head>

<body>

  <h1>Bad Request (400)</h1><p></p>

</body>

</html>



May I know the limitations in bitbucket cloud on number of files committed and removed in single commit request.

Also are there any recent changes regarding these limits as I remember committing more than 300 files in a single request.

Please help me in understanding this.

Thanks in advance. 

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2024

Hello @Gokul Rajan ,

Thank you for reaching out to the Community!

This limitation seems to be applied when committing through the API only.

In this case, if you would like to upload that many files at once, I would suggest cloning the repository locally and using git to commit and push your changes, as git will be able better manage the commit of multiple files.

Would it be possible for you to try pushing from your local using git instead of the API and let us know how it goes?

Thank you, @Gokul Rajan !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events