As my concern here is, I have old commit in my another local branch [contains abc.cpp, def.cpp].
Now after few months I want use those changes, but in my current bra
Note that with git1.8.5/1.9 (Q4 2013), git cherry-pick can now easily cherry-pick "from the previous branch":
Just like "
git checkout -
" knows to check out and "git merge -
" knows to merge the branch you were previously on, "git cherry-pick
" now understands "git cherry-pick -
" to pick from the previous branch.
See commit 182d7d from Hiroshige Umino (yaotti):
cherry-pick
: allow "-
" as abbreviation of '@{-1}
'"
-
" abbreviation is handy for "cherry-pick
" like "checkout
" and "merge
".It's also good for uniformity that a "
-
" stands as the name of the previous branch where a branch name is accepted and it could not mean any other things like stdin.