Merge code vào nhau khi khác GIT tree

1

Checkout về nhánh chứa code cần được merge

git checkout branch-need-merge
2

Copy toàn bộ commit muốn merge và vất tạm vào chỗ nào đó

git log --oneline
3

Checkout về nhánh muốn merge code khác vào

git checkout develop
4

Tạo nhánh mới

git checkout -b feature/release
5

Cherry-Pick từng commit đã copy ở bước 2 vào

git cherry-pick commit-id-1
git cherry-pick commit-id-2
6

Push code

git fetch --all
git rebase -i origin/develop
git push -u origin feature/release
7

Tạo PR

Last updated