Git Rebase from a non master branch

Hi,

Has anyone ever tried using webstorm git rebase when using a non master branch?

We have forked repos that have the branches: master (protected), test, staging etc etc.

Everyone works in test on their forks which when you attempt to rebase tries to rebase master into test. There seems to be no setting to stop it assuming master.

The upstream is set correctly and when we use master on other forks its fine but as far as we can tell webstorm is fixed on doing upstream/master into the current working branch and the only way around it currently is to perform the rebase manually on the command line.

Has anyone else come across this and found a solution? 

0
3 comments

Strange..

 

Please can you describe your steps in details? When trying to rebase from non-master branch, what do you do exactly (in WebStorm)? And what command do you use when rebasing in command line? Also, what does your branch configuration look like (in .git/config)?

 

0

Hi,

I'll give you a run down of creating the issue from scratch which includes the github settings as I suspect it may be our slightly different setup that is the issue.

In github create a repo that has 2 or more branches, lets say master & test and make it private.

In github set the default branch to be test. Then set master to be protected.

Now in github fork the repo.

From webstorm we use 'VCS/checkout from version control/Github' to checkout the fork

Webstorm correctly checks out locally the test branch in the fork.

At this point if we Rebase using VCS/Git/Rebase my github fork it will merge master into test from origin as the upstreams do not appear to be setup, but on our other repos where we do use master by default this works fine and uses the upstream.

So in webstorm we then add a remote for upstream to the original repo/

At this point if you now do a "VCS/Git/Rebase my github fork" it will rebase origin/master into origin/test (or at least that is what seems to happen, we have verified by checking the history) but we wonder if it maybe rebasing upsteam/master. Either way it is a master branch into the current branch.

This is how our .git/config looks:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/xxxxx/xxx.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "test"]
remote = origin
merge = refs/heads/test
[remote "upstream"]
url = https://github.com/xxxxx/xx.git
fetch = +refs/heads/*:refs/remotes/upstream/*

To do this manually via the command line I would do (while in the test branch):

git fetch upstream

git rebase upstream/test

Looking at the .git/config of a project that works the upsteam seem to be populated automatically, I assume by webstorm eg:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/richardjr/jsqueue.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "nautoguide"]
url = https://github.com/nautoguide/jsqueue.git
fetch = +refs/heads/*:refs/remotes/nautoguide/*
[remote "upstream"]
url = https://github.com/nautoguide/jsqueue.git
fetch = +refs/heads/*:refs/remotes/upstream/*

 

0

Thanks for detailed report! Reproduced. issue is tracked as https://youtrack.jetbrains.com/issue/IDEA-123266 and https://youtrack.jetbrains.com/issue/IDEA-128942, please vote for these tickets to be notified on any progress

0

Please sign in to leave a comment.