月亮

[git] 특정 커밋을 다른 브랜치에 병합하는 방법 How to Merge a Specific Commit into Another Branch 🤔 본문

git,github,yarn

[git] 특정 커밋을 다른 브랜치에 병합하는 방법 How to Merge a Specific Commit into Another Branch 🤔

듀네 2023. 5. 28. 23:38

원래 메인 브랜치인 master 브랜치에 내가 deploy 브랜치에서 작성한 커밋 한 개를 추가 할 일이 생겼다.

 

1. github or gitlab or gittea에서 commit hash 확인하기! 복사!

2. commit을 받으려는 브랜치(나의 경우에는 master branch에서)에서 명령어 입력

git cherry-pick 커밋 해시

 

 

더보기

i wanna deploy branch  in commit hash move to master branch.

 firstly, you are check in github or gitlab or gitrea in commit hash! and copy it!

finaily, you write 명령어 . like that git cherry-pick [commit hash].

but, you careful. 명령어를 입력하는 브랜치는 커밋 받을 브랜치에서 명령어를 작성해야한다.

 

I want to move a branch, specified by its commit hash, to the master branch.
Firstly, you need to find the commit hash on GitHub, GitLab, or another Git repository. Once you have found it, copy the commit hash.
Finally, you need to execute a command. For example, you can use the command "git cherry-pick [commit hash]." This command merges the selected commit into the current branch.
However, please be cautious. You should execute the command in the branch where you want to receive the commit. Make sure to switch to that branch before running the command.

 

출저 :

https://unpieceof.tistory.com/13

반응형
Comments