René's URL Explorer Experiment


Title: gh stack sync can fail force-with-lease push after fetching stack branches · Issue #118 · github/gh-stack · GitHub

Open Graph Title: gh stack sync can fail force-with-lease push after fetching stack branches · Issue #118 · github/gh-stack

X Title: gh stack sync can fail force-with-lease push after fetching stack branches · Issue #118 · github/gh-stack

Description: Summary gh stack sync can fetch and rebase a stack successfully, then fail during the final force push because the push uses a bare --force-with-lease with branch names instead of explicit destination refs and lease SHAs. This is most vi...

Open Graph Description: Summary gh stack sync can fetch and rebase a stack successfully, then fail during the final force push because the push uses a bare --force-with-lease with branch names instead of explicit destinat...

X Description: Summary gh stack sync can fetch and rebase a stack successfully, then fail during the final force push because the push uses a bare --force-with-lease with branch names instead of explicit destinat...

Opengraph URL: https://github.com/github/gh-stack/issues/118

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gh stack sync can fail force-with-lease push after fetching stack branches","articleBody":"## Summary\n\n`gh stack sync` can fetch and rebase a stack successfully, then fail during the final force push because the push uses a bare `--force-with-lease` with branch names instead of explicit destination refs and lease SHAs.\n\nThis is most visible in checkouts where local branch upstream/tracking configuration is missing, stale, or does not line up with the branches that `gh stack sync` just fetched.\n\n## Problem\n\nToday the push shape is effectively:\n\n```console\ngit fetch origin b1\ngit rebase ...\ngit push origin --force-with-lease --atomic b1\n```\n\nThe failure happens at the final `git push`. Git has to infer both the destination branch and the expected lease value from local branch configuration / remote-tracking refs. If that inference does not match the refs that `gh stack sync` just fetched, the push can be rejected even though the command already refreshed the relevant stack branch.\n\n## Expected Behavior\n\nAfter `gh stack sync` fetches stack branches, the subsequent force push should use the fetched local tracking refs as the lease source.\n\nFor example:\n\n```console\ngit fetch origin b1\ngit rebase ...\ngit rev-parse --verify --quiet refs/remotes/origin/b1\ngit push origin --force-with-lease=refs/heads/b1:\u003cfetched-sha\u003e --atomic b1:refs/heads/b1\n```\n\nIf someone updates `b1` after the fetch, the push should still fail safely because `refs/heads/b1` no longer equals `\u003cfetched-sha\u003e`.\n\nIf `b1` did not have a local tracking ref, the lease should use an empty expected value, so creating the remote branch still fails if someone created it first.\n\n## Proposed Fix\n\nBuild explicit per-branch force-with-lease arguments:\n\n```console\n--force-with-lease=refs/heads/\u003cbranch\u003e:\u003ctracking-ref-sha\u003e\n```\n\nand push with explicit local-to-remote refspecs:\n\n```console\n\u003cbranch\u003e:refs/heads/\u003cbranch\u003e\n```\n\nThis avoids relying on Git's branch/upstream inference while preserving the stale-ref safety guarantee of `--force-with-lease`.\n\n## Related PR\nI have a fix in my fork for reference https://github.com/ravi-pplx/gh-stack/pull/1\n","author":{"url":"https://github.com/ravi-pplx","@type":"Person","name":"ravi-pplx"},"datePublished":"2026-06-07T23:44:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/118/gh-stack/issues/118"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7bb3276a-7e2f-b7f6-0ec1-ee7ec1882045
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDC88:4950B:673CEB1:909EC80:6A503DA1
html-safe-nonce4f788f3ac46a9d58cd8bc9abac4d68bd089744a42a67c96d004e0fb647c951a0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzg4OjQ5NTBCOjY3M0NFQjE6OTA5RUM4MDo2QTUwM0RBMSIsInZpc2l0b3JfaWQiOiI1Mjk0Mjg1MjMyNjkzODUzNjAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac92b26b987aed97cbb937e0604507fb94a517724a31ad8d4e3c6be2b69816d6a9
hovercard-subject-tagissue:4609103230
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/gh-stack/118/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0ed7f2aa0ea3164a2d39d19b134cb728431c502750b6534c835a5b80c0ddc0c4/github/gh-stack/issues/118
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0ed7f2aa0ea3164a2d39d19b134cb728431c502750b6534c835a5b80c0ddc0c4/github/gh-stack/issues/118
og:image:altSummary gh stack sync can fetch and rebase a stack successfully, then fail during the final force push because the push uses a bare --force-with-lease with branch names instead of explicit destinat...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameravi-pplx
hostnamegithub.com
expected-hostnamegithub.com
Noned6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb
turbo-cache-controlno-preview
go-importgithub.com/github/gh-stack git https://github.com/github/gh-stack.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id1151630728
octolytics-dimension-repository_nwogithub/gh-stack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1151630728
octolytics-dimension-repository_network_root_nwogithub/gh-stack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released90666eaf032b7eb8975a378efe38e37f4ebb96c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/gh-stack/issues/118#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgh-stack%2Fissues%2F118
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgh-stack%2Fissues%2F118
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fgh-stack
Reloadhttps://github.com/github/gh-stack/issues/118
Reloadhttps://github.com/github/gh-stack/issues/118
Reloadhttps://github.com/github/gh-stack/issues/118
Please reload this pagehttps://github.com/github/gh-stack/issues/118
github https://github.com/github
gh-stackhttps://github.com/github/gh-stack
Notifications https://github.com/login?return_to=%2Fgithub%2Fgh-stack
Fork 18 https://github.com/login?return_to=%2Fgithub%2Fgh-stack
Star 511 https://github.com/login?return_to=%2Fgithub%2Fgh-stack
Code https://github.com/github/gh-stack
Issues 25 https://github.com/github/gh-stack/issues
Pull requests 5 https://github.com/github/gh-stack/pulls
Discussions https://github.com/github/gh-stack/discussions
Actions https://github.com/github/gh-stack/actions
Projects https://github.com/github/gh-stack/projects
Models https://github.com/github/gh-stack/models
Security and quality 0 https://github.com/github/gh-stack/security
Insights https://github.com/github/gh-stack/pulse
Code https://github.com/github/gh-stack
Issues https://github.com/github/gh-stack/issues
Pull requests https://github.com/github/gh-stack/pulls
Discussions https://github.com/github/gh-stack/discussions
Actions https://github.com/github/gh-stack/actions
Projects https://github.com/github/gh-stack/projects
Models https://github.com/github/gh-stack/models
Security and quality https://github.com/github/gh-stack/security
Insights https://github.com/github/gh-stack/pulse
#124https://github.com/github/gh-stack/pull/124
gh stack sync can fail force-with-lease push after fetching stack brancheshttps://github.com/github/gh-stack/issues/118#top
#124https://github.com/github/gh-stack/pull/124
https://github.com/skarim
https://github.com/ravi-pplx
ravi-pplxhttps://github.com/ravi-pplx
on Jun 7, 2026https://github.com/github/gh-stack/issues/118#issue-4609103230
ravi-pplx#1https://github.com/ravi-pplx/gh-stack/pull/1
skarimhttps://github.com/skarim
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.