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.7 Git Merge branch(Copying Commits)

  • combining the branch commits on git. This works as a merging child branch → master/parent branch.
  • All commits in the child branch are moved to the parent branch in a linear(time creation basis one after one) way.
  • This Merge helpful in a way that once feature branch is fully ready, then we need that feature on main application code (which is master), merge helps to copy all files and commits from feature branch to master/main(Dev) branch where we have entire code

Steps to merge :

(i) First we have to checkout to a branch where we need child/feature branch files and commits

git checkout master

(ii) Run the merge command

git merge feature-2


Observations  :

(i) Git merge will create new commit and add all files from committed branch

(ii) it wont deletes the files from the old branch