1

I created (git flow feature start branch1) and published (git flow feature publish branch1) a git flow feature branch based on develop. After them, I have this marked as a Pull Request, that another developer look at the changes in this branch. But now I want to work further, so I create a new feature branch (git flow feature start branch2) based on branch1 where is waiting for Pull Request. But after creating branch2, there are only the files, where in branch1 are ignored (all files, where matched with the condition in .gitignore).

When I checked out branch1, I see the whole dictionary with all files, but why are in the new created feature branch (branch2) not all files? So I can't work further.

I found the problem, but not the solution:

In .git/config file, there is written, that the base from my branch2 the develop branch is, and not branch1:

[gitflow "branch.feature/branch1"]
        base = develop
[branch "feature/branch1"]
        remote = origin
        merge = refs/heads/feature/branch1
[gitflow "branch.feature/branch2"]
        base = develop

With following command I can move all files from branch1 in branch2, but the base in the .git/config-file changed not to branch1...:

git rebase --onto feature/branch1 develop feature/branch2

Building with this template: git rebase --onto newBase oldBase feature/branch

How can I change the base-branch from my branch2? Simply by changing base-branch from branch2 to branch1 in .git/config?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34

1 Answers1

1

You could change the base in your .git/config but you should not.

The base for branch2 is also develop since this is the branch you want to merge to later (after branch1 is already merged).

This is also reflected in git flow feature start branch2, which does not start where you currently are but always from develop. That's the whole idea of git-flow.

Don't worry about the .git/config now unless you want to do something that your question doesn't specifically express.

Merge the PR for branch1 and then create the PR for branch2 and everything will work normally.

Dominic Frei
  • 327
  • 1
  • 5