PHPStorm Git Push never selects the right remote repository
We are 3 people in the team and have an upstream repository. Everyone has a remote to each other in case we need to fetch from them or push on their branches to contribute some code. So my git setup currently has:
- dan (coworker)
- phil (coworker)
- math (me)
- lb (upstream)
When i create a new branch to work on, i usually do:
git fetch lb development:development
git checkout -b lb-issuenum-issuedesc development
Which creates a branch and doesn't set any tracking by default. Once i commit changes to it and hit my git push binding, the form the pops up allows me to select a remote repository and set the branch name but the remote repository is like 95% of times wrong... It will select my coworker's or my upstream.
How can i setup PHPStorm or Git to prevent this from happening and always use my remote by default to save me time and trouble (yes, i sometimes don't notice it and create a branch upstream, and no, we don't want to remove permissions to write upstream for various reasons)
Please sign in to leave a comment.
Well, as a side question, why don't you use feature branches and a single remote to store all of them?
In regards to the issue, the following logic is in place:
We use a pull request workflow for most of our work so having only one remote is impossible as we fetch upstream before starting and checkout the latest applicable version to start from and then upload to our own remote to create PR. And we don't want to pollute our upstream with feature branches unless they are very specific epics that can't coexist with current release branch.
It does use the tracked branch when it finds it, that would be a bug if it didn't. But if the current branch is untracked, i can assure you it doesn't always use the last selected item which is like 99.9% mine (math) and selects most of the time a random other remote. Nothing to do with alphabetical, i can certify i'm getting lb, phil and dan relatively equaly...
Cannot reproduce this.
Please report the issue at https://youtrack.jetbrains.com/issues/IDEA (since this is common IntelliJ platform feature),
Please attach logs, and a screencast of the issue. Thank you
Hello there,
I have the same problem in RubyMine. I can't find the problem in the bug tracker, has it been created and/or addressed back then?
If not I am pleased to provide logs and screencast in order to create a issue report.
Best regards
Adrian
Odd enough, the particular submodule I want to push to always displays the remotes in reverse/random order:
...while other submodules do not:
No, the report link wasn't ever shared. Please report it at https://youtrack.jetbrains.com/newIssue
> in reverse/random order
It is hard to tell if it is random, reverse, or actually expected because there is only 2 remote. The push dialog should preselect the remote and branch that is set as tracked in git config.
Check output of git branch -vv in the submodule, it should show the tracked branches - maybe that particular repo is for some reason tracking upstream.