如何推送批准从bitbucket的一个分支提交到另一个分支

时间:2017-09-07 07:09:17

标签: bitbucket branching-and-merging git-commit

我在bitbucket中有两个分支,我想只将一些提交(由我批准)从一个分支推送到另一个分支,这是一个主分支。 有人可以向我解释我如何在bitbucket环境中做到这一点吗?

提前致谢。

1 个答案:

答案 0 :(得分:1)

您可以使用 git cherry-pick

的步骤

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

的链接

What does cherry-picking a commit with git mean?