{"record":{"id":"f972c0660a3813ea","repo":"laurent22/joplin","slug":"your-local-commit-has-not-been-pushed-to-github-r","errorCode":null,"errorMessage":"Your local commit has not been pushed to GitHub. Run git push then try publishing again.","messagePattern":"Your local commit has not been pushed to GitHub\\. Run git push then try publishing again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/generator-joplin/generators/app/templates/script/publish/steps/verifyGitState.ts","lineNumber":63,"sourceCode":"\t}\n\n\tconst remoteHeadLine = await runGit(`git ls-remote origin ${currentBranch}`, 'Could not retrieve remote HEAD. Make sure you have pushed your changes and have an internet connection.');\n\tif (!remoteHeadLine) {\n\t\tthrow new Error('Remote HEAD is empty. Make sure you have pushed your changes.');\n\t}\n\n\tconst parts = remoteHeadLine.split('\\n')[0].split(/\\s+/);\n\tif (parts.length < 2) {\n\t\tthrow new Error(`Unexpected git ls-remote output: \"${remoteHeadLine}\". Make sure your git remote and branch are configured correctly.`);\n\t}\n\n\tconst remoteHash = parts[0];\n\tif (remoteHash.length !== 40) {\n\t\tthrow new Error('Failed to extract a valid remote commit hash.');\n\t}\n\n\tif (remoteHash !== commitHash) {\n\t\tthrow new Error('Your local commit has not been pushed to GitHub. Run git push then try publishing again.');\n\t}\n\tlogger.success('Local commit is synced with remote.');\n\n\treturn commitHash;\n};\n\nexport default verifyGitState;\n","sourceCodeStart":45,"sourceCodeEnd":71,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/generator-joplin/generators/app/templates/script/publish/steps/verifyGitState.ts#L45-L71","documentation":"Thrown by verifyGitState as the final check: the remote HEAD SHA (from git ls-remote) differs from the local HEAD SHA (from git rev-parse HEAD). This means the local commit being published has not been pushed to the remote, so the published plugin would reference a commit no one else can fetch. Publish is blocked until local and remote are in sync.","triggerScenarios":"The user committed locally but did not push; the user pushed an older commit and then committed again; the remote was force-pushed by someone else diverging the history; local has uncommitted-then-amended changes not yet pushed.","commonSituations":"Developer runs `npm run publish` right after `git commit` forgetting `git push`; a post-commit hook or amend created a new SHA not yet on the remote; collaborator force-pushed the branch.","solutions":["Push the local commit: git push origin <branch>, then re-run publish.","If the remote diverged, rebase or merge first: git pull --rebase origin <branch> && git push.","Confirm sync: git rev-parse HEAD should equal git ls-remote origin <branch>."],"exampleFix":"# before\ngit commit -m 'release 1.1.0'\n npm run publish\n# after\ngit commit -m 'release 1.1.0' && git push origin main\n npm run publish","handlingStrategy":"validation","validationCode":"const local = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();\nconst remote = execSync(`git ls-remote origin ${branch}`, { encoding: 'utf8' }).trim().split(/\\s+/)[0];\nif (local !== remote) {\n  throw new Error('Local not pushed. Run: git push origin ' + branch);\n}","typeGuard":"function isInSync(local, remote) { return local === remote; }","tryCatchPattern":null,"preventionTips":["Always push before publishing: git push origin <branch>.","After amend/rebase, force-push (with team coordination) then publish.","Confirm sync: git rev-parse HEAD == git ls-remote origin <branch>."],"tags":["plugin-publish","git","generator-joplin","remote","sync"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}