- Git merge <commit> , copies the spefic commit to the checkout branch
- it is one of the way to copy a single specific commit to copy from one branch to another
- It copies the commit with same name
- it won’t change anything
Task : Copy a commit from feature-1 branch → master branch
(i). Checkout to feature branch(Here I Created feature-1 branch, Added f1,f2 files and committed)
git checkout feature-1 |
(ii) Checking log to copy the commit hash
git log –oneline |
(iii) Checkout to master and checking the commit history before merge commit
git checkout master |
git log –oneline |
git merge <commit-hash> |
(v) Log history : We can see commit is copied to master branch with same commit hash
git log –oneline |