hub: Hub sync exit status 128
git version 2.24.0 hub version 2.13.0
Trying to run hub sync always fails with: exit status 128
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (4 by maintainers)
git version 2.24.0 hub version 2.13.0
Trying to run hub sync always fails with: exit status 128
I’ve also been encountering this issue recently, ever since we changed the default branch in our repository (we use Bitbucket). Editing
.git/refs/remotes/origin/HEADto point to the new default branch name solved the issue for me.In my case, the remote repository change default branch from
masterintomain. Below command output that hub still tries to callrev-parsetomasterTherefore running command
git remote set-head origin mainsave my time from remove & re-clone the repository (ref).version-bump seemed to point at a non-existent branch in remote not sure how it happened, but force removing
badpirate/version-bumpallowed the hub sync to succeed. Going to leave open as likely the error could be recognized, or better logged.Okay, this reproduces regularly and requires manual repair each time. (note I’m on a Gitlab server)
Repro
hub sync->status 128In this case it seems the rev parse
git rev-parse -q refs/heads/badpirate/version-bump refs/remotes/origin/dmzpoints the removed local branch back at the wrong branch (dmz)… this was a branch we had previously had selected as the root of our tree, but switched back to master in GitLab and dumped the old dmz branch after merging.I’m going to remove my local repo and re-clone to see if the problem goes away, and I’ll update this task.
I also had this. Also caused by branches that I had locally that were tracking remote branches that no longer existed (due to GitHub “delete branch” feature). Luckily I found this issue for the
HUB_VERBOSE=1. Would have helped ifhub sync --helpreferenced that… I was looking for a-vinstead.My apologies @mislav , didn’t grab that command while I was reproducing, I removed the repo and re-cloned and haven’t been seeing the issue any more. Going to leave that as a way to workaround this issue (while kind of a pain) in case anyone else sees it and close.