문제

I find myself doing this a lot when cherry-picking a commit from another branch.

$ git log -1 another_branch
commit <commit_sha>
// copy <commit_sha>
$ git cherry-pick <commit_sha>

Can I do all of this in one command, if so, what is it?

도움이 되었습니까?

해결책

Just go with:

$ git cherry-pick another_branch

This will cherry-pick the last commit from another_branch.

Branches in git are just references to the last commit in that branch, you can use them instead of commit SHAs in your commands.

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