1

I have two branches in bitbucket and I want to push only some commits (which are approved by me) from one branch to another branch which is a master branch. Can someone explain to me how I can do it in the bitbucket environment?

Thanks in advance.

Maryam Koulaei
  • 750
  • 2
  • 9
  • 17

1 Answers1

1

you can use git cherry-pick

steps

1. git log 
  this will list all commits take the commit id which you wanted to move.
2. git cherry-pick <commit-id>
  apply this after switching to master branch
3.then push new master to remote
  git push  <REMOTENAME> <BRANCHNAME> 
  eg. git push origin master
  or 
  git push  <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME> 
  eg:
    if my remote name is heroku and i want to push local heroku branch to heroku(remote) master barnch(heroku/master) 
    git push heroku heroku:maste

links

What does cherry-picking a commit with git mean?

suhail areekkan
  • 1,646
  • 1
  • 13
  • 16