Reputation: 5091
In my git
master I have 2 branches as production
and testing
. I do all work with testing. at present example my production version is 5. my testing version is 20. now I would like to update the production version from testing version of 15.
for that, how can i select the testing version of 15 and copy or merge to production version of 5? ( if the new testing version commit as id of 6 in the production version that' fine )
if anything wrong here please excuse me.
I don't have any idea. please help me.
Upvotes: 0
Views: 1944
Reputation: 2410
I would suggest you checkout (git checkout
) the testing branch at the specific commit for version 15. then create a temporary branch git checkout -b version15merge
and merge git checkout production && git merge version15merge
this stuff into your production
branch.
Upvotes: 1
Reputation: 16650
Use git cherry-pick <commit-hash from the source branch >
when your destination branch is checked out. In your case find the commit-hash of version 15 in testing branch and then checkout the master branch and run the below:
git cherry-pick <commit-hash of version 15 from testing branch>
Upvotes: 0
Reputation: 38629
If you want to copy single commits, use git cherry-pick
.
If you want to merge all changes in testing
up to 15
, just use git merge 15
to merge over the changes to production
.
Upvotes: 0