0

I have two branches namely old branch(currently working branch) and new branch. I want to push the old branch commit changes to new branch. Here what i followed the steps:`

Clone old branch and changed head and refs to new branch
then executed git cherry-pick --strategy=recursive -X theirs commit_name
After executing above command i see few lines +added and deleted
(The commit_name has 6 files)

In commit, i see only 3 files which have been corrected by inserting and deleting lines, but i couldn't see the remaining files to push to gerrit.

Please could someone help me out here. Please note i am not familiar with git stuff.

louis
  • 595
  • 3
  • 9
  • 24
  • I don't understand what you want to do - can you explain the **why** in more detail (e.g. why do you want to `cherry-pick` instead of `merge`)? And by the way, please use the standard definitions of the words (you **push** from one repository to another but you **merge** from one branch to another / you **clone** a repository but you *create* a branch by **git branch**). – Niklas P Nov 22 '16 at 15:40

1 Answers1

0

You can you rebase: from the new branch execute git rebase old_branch, resolve conflicts if any and you have all changes from old_branch in new_branch. Also you can git merge old_branch, it will do the same and create additional merge commit.

Gennady Kandaurov
  • 1,914
  • 1
  • 15
  • 19