gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Gitbutler pushing to the wrong remote

Open Dekker1 opened this issue 7 months ago • 3 comments

Version

0.14.19

Operating System

macOS

Distribution Method

dmg (Mac OS - Apple Silicon)

Describe the issue

I'm running Gitbutler with the "target" pointing to a common upstream repository upstream (owned by an organisation) and my "create branches on remote" is set to fork (my personal fork).

When working on PRs, everything work well until I press the "Force push" button. Rather than pushing to the origin (or other external fork of the repository), it will instead push to a new branch on fork. This is then unrelated to the PR that I'm actually working on.

How to reproduce (Optional)

  1. Create a new GH repo user1/repo using a user 1.
  2. Make a fork user2/repo using user 2.
  3. Create a PR with user 1, where user 2 has edit permission.
  4. Clone the repository locally using user1/repo as fork remote and user2/repo as fork.
  5. Open repository using Gitbutler and set "target" to user1/main and "create branches on remote" to user2
  6. Open the created PR, make a change, commit, and "force push".

Expected behavior (Optional)

  1. Changes to appear in user1 and added as additional commits to the relevant PR.

Relevant log output (Optional)


Dekker1 avatar May 12 '25 07:05 Dekker1

Thanks a lot for reporting!

This looks like a somewhat complex setup and I am probably not following exactly what this would imply for the GitButler remote setup, but it seems like some part of the configuration is 'confused'. Maybe for @krlvi the issue seems clearer though.

Byron avatar May 12 '25 07:05 Byron

I'm not sure whether this is as complex a situation as it might seem. I think many maintainers will run into the situation where they will change PRs before merging them. Essentially, my expectation is just that when I work on a branch from a specific remote, that any changes I make would be pushed back to that remote.

Dekker1 avatar May 12 '25 09:05 Dekker1

Essentially, my expectation is just that when I work on a branch from a specific remote, that any changes I make would be pushed back to that remote.

Sorry for potentially misrepresenting this issue as complex after reading the reproduction guide. Indeed, when phrased like this I'd absolutely share that expectation.

Byron avatar May 12 '25 11:05 Byron