문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top