Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Merge - Not merging all changes from remote branch

Tags:

git

I branched from master and created a branch called extra_work. Then I made lots of changes to master which included removing some files as well. Later now when I tried to merge the branch 'extra_work' into the master, it is not merging it entirely. It is not adding the files that I removed in master, basically all the work that I had undone, now I want it back into my master. How do I merge these two branches so that all the extra files/work from my 'extra_work' branch merges into master. Thanks

like image 541
janegee Avatar asked Jan 28 '11 15:01

janegee


1 Answers

Rebase your extra_work branch against master. This will rewind your extra_work branch to the state when you branched, and apply the commits from master to extra_work. It will then replay all the commits from extra_work back onto itself. If you inspect git log after that you will see the commits from master further back in the history of the branch. You should then be able to merge to master with no problems.

git rebase master
like image 106
Adam Avatar answered Sep 30 '22 17:09

Adam