Git: How to merge a specific commit into a branch?

Share:
Git: How to merge a specific commit into a branch? ## Description ```sh git:(9b80c1b) git push fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD) state now, use git push origin HEAD: git:(9b80c1b) git checkout master Warning: you are leaving 1 commit behind, not connected to any of your branches: 9b80c1b Save Keyframe trajectory If you want to keep it by creating a new branch, this may be a good time to do so with: git branch 9b80c1b Switched to branch 'master' Your branch is up to date with 'origin/master'. ➜ git:(master) git cherry-pick 9b80c1b [master ab2adaa] Save Keyframe trajectory ``` I do a commit not on a branch. I want to merge it with **master** brance. ## Solution ```sh git cherry-pick 9b80c1b ``` ![yubao_blog_cover](https://raw.githubusercontent.com/yubaoliu/assets/image/yubao_blog_cover.png)

No comments