SAGARFIVE

1. Introduction

2. Git Basics

3.  Git Terminology

4.  Git Branching

5.  Git - Github

6.  Git Add (Git staging)

7.  Git Commit

8.  Github Advanced

9.  Git Remote

7.8 Git Merge commit(Copying Commits fast forword)

  • 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

(iv) Merging commit

git merge <commit-hash>

(v) Log history : We can see commit is copied to master branch with same commit hash

git log –oneline