Skip to main content
added 236 characters in body
Source Link
Mohammad Raheem
  • 1.2k
  • 1
  • 13
  • 24

You can use cherry-pick:

Let say you have two branch A and B and mistakenly done a commit in a wrong branch B

Take the commit id you want to add to otherit from the branch by git log. GoB using

 git log 

Got to the branch byA using

git checkout <branch-name> 
git checkout A

Now do cherry-pick using:

git cherry-pick <commit-id>

If you get conflicts resolve it and do checkout <branchgit name>add and then commit.If you want to add that commit and do :abort cherry-pick use

git cherry-pick <commit-id>-abort

You can use cherry-pick:

Take the commit id you want to add to other branch by git log. Go to the branch by checkout <branch name> you want to add that commit and do :

git cherry-pick <commit-id>

You can use cherry-pick:

Let say you have two branch A and B and mistakenly done a commit in a wrong branch B

Take commit it from the branch B using

 git log 

Got to branch A using

git checkout <branch-name> 
git checkout A

Now do cherry-pick using:

git cherry-pick <commit-id>

If you get conflicts resolve it and do git add and then commit.If you want to abort cherry-pick use

git cherry-pick --abort
deleted 5 characters in body
Source Link
user47589
user47589

You can use cherry-pick:

Take the commit id you want to add to other branch by git log. Go to the branch by checkout <branch name> you want to add that commit and do :

You can use cherry-pick:
Take the commit id you want to add to other branch  by git log ,
Go to the branch by checkout<branch name> you want to add that commit 
and do : git cherry-pick <commit-id>
You can use cherry-pick:
Take the commit id you want to add to other branch  by git log ,
Go to the branch by checkout<branch name> you want to add that commit 
and do : git cherry-pick <commit-id>

You can use cherry-pick:

Take the commit id you want to add to other branch by git log. Go to the branch by checkout <branch name> you want to add that commit and do :

git cherry-pick <commit-id>
Source Link
Mohammad Raheem
  • 1.2k
  • 1
  • 13
  • 24

You can use cherry-pick:
Take the commit id you want to add to other branch  by git log ,
Go to the branch by checkout<branch name> you want to add that commit 
and do : git cherry-pick <commit-id>