0

As part of my continuous integration process, I am trying to push to Heroku the latest tag from my github:

./git-clone-latest-tag git@github.com:user/repo.git ~/api
cd ~/api
git checkout -b master
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master -f

The push gives me the following error:

fatal: protocol error: bad line length character: erro
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://git.heroku.com/*************.git'

From my research, it seems due to the fact that you cannot push a tag to a remote branch, but my git skills are minimal, and I have no idea if it is the real problem and how to solve it (this is why I tried git checkout -b master). I also tried pushing master^{} based on the linked solution, but that didn't work either.

If it helps, my script git-clone-latest-tag:

# a few commands to identify $latesttag before cloning
git clone --branch "$latesttag" --depth 1 --shallow-submodules --recurse-submodules "$remote" "$target"
Carlo
  • 380
  • 1
  • 12

0 Answers0