I am tying to push the current branch from azure devOps (using ADO pipeline) to AWS CodeCommit repository.
This code CommitCommit repository is freshly created and has no branches/commits/tags in it.
I use below commands:
First set the remote URL for AWS CodeCommit:
git remote set-url origin https://${AWS_GIT_USERNAME}:$(urlencode ${AWS_GIT_PASSWORD})@${{AWS_CODECOMMIT_REPO_NAME}}
Secondly I push the current branch to AWS code commit:
git push -f origin HEAD:$(Build.SourceBranch)
But I get the below error while this push command runs
remote: Unknown commit c634834dhjh45j34
error: remote unpack failed: Unknown commit c634834dhjh45j34
To https://git-codecommit.us-east-2.amazonaws.com/v1/repos/my_codecommit_repo_name
! [remote rejected] HEAD -> master (unpacker error)
error: failed to push some refs to 'https://git-codecommit.us-east-2.amazonaws.com/v1/repos/my_codecommit_repo_name'
##[error]Bash exited with code '1'.