Pull request from forked repo: "A branch with that name already exists."
See original GitHub issueDescribe the bug
After upgrading to 2.6.1 (apparently), re-selecting a PR branch from a forked repo fails with the error “A branch with that name already exists.”
Version & OS
- GH Desktop: 2.6.1
- MacOS: 10.14.6
Steps to reproduce the behavior
- Clone the storybook repo: https://github.com/storybookjs/storybook
- Select a PR from a forked branch, e.g.
pr/13142
- Select a non-forked branch, e.g.
next
- Re-select the PR from the forked branch in #2
- See error “A branch with that name already exists.”
Note that selecting a second PR from the same fork, e.g. pr/13429
, will succeed after performing these steps. And then selecting another branch and re-selecting pr/13429
will fail with the same error.
Expected behavior
I expect to be able to freely switch between branches, including PRs from forked repos.
Actual behavior
Selecting a branch on a forked repo fails the second time around.
Logs
2020-12-16T02:11:24.810Z - info: [ui] Executing fetch: git -c credential.helper= -c protocol.version=2 fetch --progress --prune github-desktop-BarryThePenguin (took 2.222s)
2020-12-16T02:11:25.178Z - error: [ui] `git branch pr/13429 github-desktop-BarryThePenguin/update-ember-cli` exited with an unexpected code: 128.
stderr:
fatal: A branch named 'pr/13429' already exists.
(The error was parsed as 26: A branch with that name already exists.)
Additional context
- Checking out PRs from forked repos is a regular part of my workflow, and the problem seems to have been introduced very recently, probably in
v2.6.1
. - Manually deleting the branch locally on the command line
git branch -d pr/13429
is a temporary workaround.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Github can't create a Fork from a branch, repository already ...
Forking a repo with a different name within the same org is not available yet, but it will be added very soon it...
Read more >Creating merge requests - GitLab Docs
On the top bar, select Main menu > Projects and find your project. · On the left menu, select Repository > Branches. ·...
Read more >Forking a GitHub Repository and Using Pull Requests
In Github, navigate to the repository to be forked and select “Fork” on the upper right. Select your own user name when prompted....
Read more >Remote Origin Already Exists Error: How To Fix It | CloudBees
Go to your local repository and remove the existing origin remote. Add the new online repository as the correct origin remote. Push your...
Read more >How to Sync and Update a Forked Repository - Section.io
Your branch content is on your remote GitHub repository, and you need to create a pull request to the origin repository to contribute...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
for those with this issue, here’s how I resolved it on GitHub Desktop:
Facing the bug in Version 2.8.6 (x64) Windows aswell