{"thread":{"id":"66278","subject":"Solution searched how to rebase/merge an existing commit to the reference of an Github PR","startedAt":"2026-09-05T20:26:08Z","lastAt":"2026-09-05T20:26:08Z","messageCount":1,"participants":["Erdhoernchen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"552054","messageId":"1710398737.20260905222604@WKraft.org","threadId":"66278","inReplyTo":null,"subject":"Solution searched how to rebase/merge an existing commit to the reference of an Github PR","fromName":"Erdhoernchen","fromEmail":"mailinglist-git@erdmul.de","sentAt":"2026-09-05T20:26:04Z","receivedAt":"2026-09-05T20:26:08Z","isPatch":false,"body":"Hello to all,\n\nI hope, that this list is the right place for my question.\n\nI have set up a 3-Layer Git infrastructure, with Github as the topmost repository.\n\nBelow is a local dispatch-repository from where I will pull PRs from Github and \npush all local changes up to github. No code changes are done here, this is transitory only.\n\nThe lowest tier is the development repository, where daily changes are happening.\nHere I have several branches for new functionality or some older code as reference.\n\nAs the main branch is a high volume repo, with autocommit on succesful compiles\nthere is a separate branch for pushing fixes and new functions to. \nThis is an orphan branch, which gets updated from time to time, when new functions \nor fixes should be deployed to the upper repos. Here I create the commits, which should\nbe finally arrive in Github. Using Conventional Commits Information about what the commit\nis good for, is included.\nThis works already perfect. Once a new version or a fix should be deployed, all\nchanged files are checked out into the release repo, and a single new commit is\nissued.\n\nThis branch gets pulled from dispatch-repository and from there it will be pushed \nto Github.\n\nSo this direction is works just perfect. \n\nMy problem are now PRs coming from Github.\n\nMy workflow is here the following:\nFrom the dispatch-repo I pull a patchfile with all changes from the PR and store this\npatchfile in a directory, which can be accessed by the development repo. \nIn the development repo I use the patchfile to make the needed changes and bring them\nto a new commit in the release branch.\n\nThis commit has no reference to the Github-PR besides the information in the commit\nmessage: \"fix: merged (#123) to solve ....\"\n\nNow I need a way, to integrated this release commit into the dispatch-repository \nand finally to Github with just a single commit.\nI need to integrate it in the PR branch, I have fetched with: \n\n`-git fetch origin +refs/pull/*/head:refs/heads/pr/*`\n\nHow can I make a three way merge or a rebase, so that the PR in the pr/xxx branch\nis used as the reference for Github, to close the PR as solved and merged, even\nwhen my local repository is some commits ahead to the PR.\n\nThis is the usual situation, but I my goal is, to get this done in one single commit,\nwhich has the ID from my development:release branch, so that the next commit from\nthere, will fit into the chain, without the need to merge ghost commits back.\n\nSo the picture looks like:\n\n          +------------------+\n-->PR/x-> |   GitHub         |\n          +------------------+\n             |        ^  ^\n             |        |  |\n             v        |  +----how to manage this\n          +------------------+    ??????           << here is my problem\n          | Dispatch  |      |-->pr/x branch\n          +------------------+           ^\n             |        ^                  |\n       patchfile x    |                  |\n             |     new version<---+      |\n             v                    |      |\n          +------------------+    |      |\n   main <-|  development     |--> release branch\n          +------------------+          \n            |   |   |\n            v   v   v\n            different\n            development \n            branches\n\nThe direction from release for new versions/fixes not releated to an PR are working flawless!\nOnly the direction, how I can handle the commit from release, so that is based on the PR\nthat Github will merge and close the PR is my problem.\nMy goal is, to solve this in my repo without media disruption, by changing for single actions\nto the Browser window.\n\nThanks for useful hints. My goal is, to solve this with pure git functionality\nwithout gh or other helpers.\n\nIf this is not the right list for such questions, I would be very glad, to get\nsome informations, where I can discuss this problem with real git experts/enthusiats.\n\n\n\nKind regards\n\n  e.\n\n"}]}