Giter VIP home page Giter VIP logo

merging-process's Introduction

Merging process in Git

A Fast forward merge

  • A fast-forward merge is possible when there are no further commit created in the receiving branch after the branch being merged was created. eg a feature branch

  • It just move the main branch pointer to the last commit in the feature_branch

Fast-forward Merging process

  1. Create a new branch called feature-1 from the main branch.
  2. Make changes in the new branch and commit them.
  3. Checkout the main branch, in this case which will be the receiving branch.
  4. Merge the feature branch into the current receiving branch
git checkout -b feature-1

git commit -a -m "changes in  the feature 1 branch"

git checkout main

git merge feature-1

A three-way merge process

===============================

  • Happens when there are new commit in the receiving since the current branch was created.

  • A new merge commit is created which is the parent of the last two commits being merge

Three way merging process

During a three way merge-process, if the same file was edited in both branches, a merge conflict will happen. To resolve the conflict manually, you can use an editor/; lke nano and VScode.

  • You can decide:

    1. Keep both changes you made
    2. Accept changes from the incoming branch in this case the merge-conflict branch
    3. You can also decide to keep the changes in the receiving branch
  • A merge conflict may happen during three-way merge process, when you make changes to to the same file before the merge commit is created

  • Git will ask you to resolve all the conflict before it proceeds with the merge of the two branches

merging-process's People

Contributors

404xavier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.