Sync fork with upstream via rebase, not merge #48935
Replies: 8 comments 1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
-
There's no "Merge" button, nor the "Edit" button next to it, on that page... There's only the "Create pull request" button under the input box for the PR detailed description. The button has a down arrow allowing to select "Create pull request" (checked by default) or "Create draft pull request". Looks like there's a step (or two) missing in the above details... |
Beta Was this translation helpful? Give feedback.
-
|
At |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Is it really too hard or impossible? |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Right now, GitHub’s “Sync fork” button in the web UI only supports a merge update from upstream — there’s no built‑in option to rebase via the UI. If you want a rebase (to keep a linear history), you’ll need to do it locally and then push the result back to your fork. Here’s how to rebase your fork onto upstream from the command line: 1. Add the upstream remote (only once)git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPO.git 2. Fetch the latest changes from upstreamgit fetch upstream 3. Switch to your main branchgit checkout main 4. Rebase your branch onto upstream/maingit rebase upstream/main 5. Push the rebased branch to your forkgit push --force-with-lease origin main Notes: Replace main with your default branch name if it’s different. --force-with-lease is safer than --force because it won’t overwrite others’ work. If you prefer not to rewrite history, stick with the UI’s merge option instead. Alternative: If you use the GitHub CLI, you can run: gh repo sync --force --branch main …but even here, rebase isn’t the default — you’d still need to handle it manually. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
Is there a way to sync my fork with upstream from UI via rebase, but not a merge?
It would be a super awesome to have an option for this action
Beta Was this translation helpful? Give feedback.
All reactions