Pregunta

I have 2 branches master staging, assuming I have 10 commits in master after I merged to staging a while ago. Now I would like to merge only the first 5 commits out of 10 into staging branch. How do I specify that in git.

¿Fue útil?

Solución

first, look through your commit history, and get the commit you want to merge from the master branch, you should see something like this:

$> git log
[...]
commit c5960dbe4674ae72f80cbe1ed5eb0cc690062c7a
Author: (...)
Date:   Mon Nov 18 11:42:58 2013 +0100

this is a commit message!
[...]

now switch to your staging branch and run

$> git merge <commit-id>

If you didn't do anything weird, git should be able to fast forward this, and you're done.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top