Hi Team,
I'm unable to push the code to the codecommit repo from the bitbucket repo using the bitbucket pipeline.
Its throwing the below error. Kindly help to resolve this.
Thanks,Satty
Hi Satty and welcome to the community!
Does this build run on a branches definition in your yml file? If not, could you please let me know what type of pipeline it is?
In case it is a branches pipeline, Pipelines clones by default the last 50 commits of the branch during a build. You can try specifying a full-depth clone for this step so that the push succeeds:
I've also seen other users report that the error occurs when they push from Bitbucket Cloud to an empty CodeCommit repository. If the CodeCommit repo is empty, you can try pushing first from your local machine and then see if subsequent builds succeed.
Kind regards,Theodora
Hello Theodora,
Thank you so much for your response.
We are using the default pipeline property. FYI, I am including the screenshot of the pipeline below.
Also we have tried pushing the code for the same branch to the codecommit manually, even after that also we are getting the below error. Its showing as "unknown commit" after making changes and when the pipeline runs.
Your help in resolving the issue would be greatly appreciated !!
Hi Satty,
I would like to ask some questions about your setup and your goal so I can better help you.
The default pipeline will run on a commit to every branch of the Bitbucket repo.
The git push command you have in your yml file will try to push to the development branch of the CodeCommit repo.
1. Does your CodeCommit repo have a branch named development?
2. Does your Bitbucket repo have a branch named development?
If yes, does the Bitbucket repo have other branches, apart from the development branch?
3. If both repos have a development branch, can you please check if these branches (in CodeCommit and Bitbucket) share some history? (that is, do they have some common commits already?)
4. If your Bitbucket repo has multiple branches, do you want to push the development branch of Bitbucket to the development branch of CodeCommit only?
Or do you want to push other branches of Bitbucket to respective branches of the CodeCommit repo?
Hi @Theodora Boudale ,
Thanks for the quick response.
Please find the below answers to your previously asked questions,
Ans: We had development branch as we have manually pushed it to codecommit. But when we tried to sync from bitbucket it didn't work so we have created a separate branch with other name.
Ans: Yes, the bitbucket repo have "development" branch along with other branches too.
Ans: There is no commit history found in the remote repo (codecommit).
Ans: Yes, we only want to push the development branch to codecommit.
It looks like you're new here. Sign in or register to get started.