Reputation: 513
This is based on the git flow methodology where you have a master and develop branch and features are branched from develop with pull requests from features to develop.
So I've finished working on a feature branch and I've submitted a pull request to get it merged to develop. Now I want to work on a new feature that has a dependency on the changes in my previous feature. If I do a merge locally, how do I reconcile after the pull request is eventually approved and develop is ready to be updated?
I'm guessing this will be based around a merge and a rebase but I'm not 100% sure and I don't really want to trash my local repo or end up double committing things.
Upvotes: 0
Views: 516
Reputation: 1
I'm fairly certain you can do
git rebase origin
and that would rebase from the tracking branch of origin.
Upvotes: 0
Reputation: 312530
So I've finished working on a feature branch and I've submitted a pull request to get it merged to develop. Now I want to work on a new feature that has a dependency on the changes in my previous feature. If I do a merge locally, how do I reconcile after the pull request is eventually approved and develop is ready to be updated?
Assuming you started with something like:
git checkout -b feature/my-feature-1 devel
You would start your new feature based on that one:
git checkout -b feature/my-feature-2 feature/my-feature-1
And do your work on that branch. Once my-feature-1
has landed in the devel
branch, you could rebase my-feature-2
on the devel
branch:
git checkout feature/my-feature-2
git rebase devel
And now you have a branch that is based directly on devel
.
Upvotes: 1