Skip to content

How to copy the changes from one branch to a sibling branch #143466

Answered by quintyn
guostong asked this question in Repositories
Discussion options

You must be logged in to vote

Yes to copy changes from prod release to dev, you can:

  1. Merge: Switch to the Dev branch and merge in the Production branch. This brings all changes over at once.

git checkout dev
git merge production-release-branch

  1. Cherry-pick: If you only want specific commits (like a hotfix), you can cherry-pick them from Production into Dev.

git checkout dev
git cherry-pick

  1. Rebase: For a cleaner history, you could rebase Dev onto the Production branch, though this can be more complex if there are conflicts.

git checkout dev
git rebase production-release-branch

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@guostong
Comment options

Answer selected by guostong
Comment options

You must be logged in to vote
2 replies
@guostong
Comment options

@abdulrahmanRadan
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage Question
4 participants