After following the CLI's suggestion (Push your branch to the remote before syncing.), chunk sidecar sync / chunk sidecar setup continues to fail with Could not resolve remote base. on projects created via git init. Setting the upstream with git push -u is not sufficient — origin/HEAD must also be set explicitly.
Steps to reproduce
mkdir my-project && cd my-project
git init
git add . && git commit -m "init"
git remote add origin git@github.com:<org>/<repo>.git
git push origin main # initial push
chunk sidecar setup # fails: "Could not resolve remote base."
git push -u origin main # set upstream as suggested
chunk sidecar setup # still fails with the same error
Expected behavior
Either:
- The CLI suggestion is sufficient to resolve the issue, or
- The error message identifies the missing piece (
origin/HEAD) and provides the exact commands needed
Actual behavior
git push -u origin main sets the upstream tracking branch, but chunk sidecar sync still fails:
✗ Error: Could not resolve remote base.
Suggestion: Push your branch to the remote before syncing.
The same suggestion is shown regardless of how many times it is followed. The underlying issue — that origin/HEAD is not set — is never surfaced.
Resolution
The following three commands are required (not just the suggested push):
git push -u origin <branch>
git fetch origin
git remote set-head origin -a
Verify with:
git symbolic-ref refs/remotes/origin/HEAD
# should print: refs/remotes/origin/<default-branch>
Root cause
MergeBase() in internal/gitutil/gitutil.go resolves the remote base via git merge-base @{upstream} origin/HEAD, falling back to git rev-parse origin/HEAD. Both paths require origin/HEAD to be present.
git clone sets origin/HEAD automatically. git init → remote add → push does not — it requires an explicit git fetch + git remote set-head origin -a.
The current suggestion only covers the upstream (git push -u), which is necessary but not sufficient.
Suggested fix
- Expand the suggestion to include the full sequence:
git push -u origin <branch> && git fetch origin && git remote set-head origin -a
- Add a secondary message when the upstream is already set but the error persists, indicating that
origin/HEAD is missing.
- Update the skill's Troubleshooting section for
Could not resolve remote base to document this git init scenario explicitly.
Workaround
git push -u origin main
git fetch origin
git remote set-head origin -a
chunk sidecar setup # succeeds
Environment
- chunk-cli version: 1.2.0 (skill v1.3.0 Troubleshooting section also does not document this)
- OS: macOS
- Project created via:
git init (not git clone)
After following the CLI's suggestion (
Push your branch to the remote before syncing.),chunk sidecar sync/chunk sidecar setupcontinues to fail withCould not resolve remote base.on projects created viagit init. Setting the upstream withgit push -uis not sufficient —origin/HEADmust also be set explicitly.Steps to reproduce
Expected behavior
Either:
origin/HEAD) and provides the exact commands neededActual behavior
git push -u origin mainsets the upstream tracking branch, butchunk sidecar syncstill fails:The same suggestion is shown regardless of how many times it is followed. The underlying issue — that
origin/HEADis not set — is never surfaced.Resolution
The following three commands are required (not just the suggested push):
Verify with:
git symbolic-ref refs/remotes/origin/HEAD # should print: refs/remotes/origin/<default-branch>Root cause
MergeBase()ininternal/gitutil/gitutil.goresolves the remote base viagit merge-base @{upstream} origin/HEAD, falling back togit rev-parse origin/HEAD. Both paths requireorigin/HEADto be present.git clonesetsorigin/HEADautomatically.git init→remote add→pushdoes not — it requires an explicitgit fetch+git remote set-head origin -a.The current suggestion only covers the upstream (
git push -u), which is necessary but not sufficient.Suggested fix
origin/HEADis missing.Could not resolve remote baseto document thisgit initscenario explicitly.Workaround
git push -u origin main git fetch origin git remote set-head origin -a chunk sidecar setup # succeedsEnvironment
git init(notgit clone)