filpa
filpa

Reputation: 3654

Merged feature branch into master - continue working on feature branch with new master changes?

I have the following scenario:

  1. git checkout feature_branch
  2. Did some work on feature_branch
  3. In the meantime, master was updated with things that I want to have in feature_branch as well
  4. Pushed changes in feature_branch to origin
  5. git checkout master && git pull && git merge fr_1285

Now master is up to date and has all my changes in it (I'm not sure this is exactly what I wanted, though).

From this point, how can I continue working on my own (already pushed) feature_branch using the updated files in master? Have I already screwed up?

Upvotes: 0

Views: 64

Answers (2)

Endre Simo
Endre Simo

Reputation: 11541

First commit the changes to the feature branch, then do git checkout origin master prior to do a git pull to the master (you will have all the codebase in the origin master up to date). Then you can merge the feature branch to the master branch by:

git merge feature_branch

You need to finalize with a git push origin master to have all the changes from future branch included in the master branch.

You can continue your work on the feature branch by checking out.

git checkout feature_branch

Upvotes: 1

Dmitry
Dmitry

Reputation: 57

You could get all your changes from master to feature _branch by rebasing feature_branch onto master

Upvotes: 0

Related Questions