0

I have two branches now master and dev. They are parallel. I have added several commits to my master branch and now I need just to get all these changes in the dev branch, but do not have a copy of master, because I have some source files in the dev branch.

And branches should be parallel as they are now, without merging and other stuff.

How can I do this ?

  • Export the diff patches from the master branch and apply them to the dev branch. https://coderwall.com/p/yeh5tw/how-to-create-and-apply-a-patch-with-git – matfax Mar 25 '17 at 11:19
  • 1
    Possible duplicate of [How to merge a specific commit in Git](http://stackoverflow.com/questions/881092/how-to-merge-a-specific-commit-in-git) – matfax Mar 25 '17 at 11:21

1 Answers1

0

If you want to apply changes from a commit on master branch to dev branch, you can use git cherry-pick <the commit from master>.

If you want to apply changes from a serial of commits on master branch to dev branch, you can use git rebase --onto dev <start commit from master> <end commit from master>.

Note: the start commit is not including to rebase, but the end commit is included. So the range is commit next to start commit~end commit.

Marina Liu
  • 32,805
  • 4
  • 48
  • 60