Source Control (4-9-1), Git - Merge in Server Side

This is a series of articles related to Source Control or Version Control issues, from a stand-alone app, such as MS SourceSafe, to a Server app, such as MS TFS (Team Foundation Server), to web services such as GitHub, AWS, and MS Azure DevOps. We have tried to categorize this series of articles as Source Control or Version Control, but this site does not have these categories. So, we put the articles in the DevOps category, as explained in the Wiki:

DevOps is a set of practices that combines software development (Dev) and IT operations (Ops). It aims to shorten the systems development life cycle and provide continuous delivery with high software quality.[1] DevOps is complementary with Agile software development; several DevOps aspects came from the Agile methodology.

The structure of this article series will cover:

  • Stand Alone App:
    • MS Source Safe
  • Server App
    • MS TFS (Team Foundation Server)
  • Online (Cloud) Centralized Service:
    • MS Azure: DevOps
      • Boards
      • Repos
      • Pipelines
      • Test Plans
      • Artifacts
    • GitHub
    • AWS GitHub Enterprise
  • Distributed App:
    • Git

Because these are huge topics, I will not go step by step. Instead, each section will be relatively independent and will become a reading unit.

Introduction

We have discussed Merge for TFS in the article, Source Control (2-2), TFS --- Merge.  We also discuss a little bit about Git Merge in the article, Source Control (4.9), Git --- Merge: Fetch, Pull, Push and Sync. Now I will discuss more about Git Merge, 

  • In Server Side: 
    • MS DevOps
    • MS GitHub
    • GitLab
  • In Client Side:
    • in Visual Studio
    • by Git Prompt Command

I should emphases here, TFS Merge and Git Merge are quite different concept, while TFS is a server side centralized Software, client side interface, such as Visual Studio, is just a dummy interface, that is synchoronous with server, as a input/output interface at al, Git is a client side or distributed Software in client side, that is an independent software, it can be a indenpendent system working in client machine, the conversation to server, just push/pull the result to/from server to make client and server synchoronously.

In IDE, such as Visual Studio, you have to choose either using TFS or Git, choose:

Menu Bar => Tools => Options => Source Control => Plug-in Selections, got:

Git:

TFS:

Compared to TFS Merge, Git Merge has more choices, such as from Merge Strategies in Git - GeeksforGeeks, that

  • Fast Forward
  • Recursive
  • Ours
  • Octopus
  • Resolve
  • Subtree

But we will not discuss that kind of complex types, we will only discuss the basic types, say, most often happening in different Source Control Servers, 

  • Merge in Servers
    • Merge in DevOps
      • Merge (no fast forward)
      • Squash Merge
      • Rebase Merge
      • Semi-Linear Merge
    • Merge in GitHub
      • Merge (no fast forward)
      • Squash Merge
      • Rebase Merge
    • Merge in GitLab
      • Merge (no fast forward)
      • Squash Merge
  • Merge in Client
    • Merge in Visual Studio
      • Merge (no fast forward)
      • Squash Merge
      • Rebase Merge
    • Merge in Git --- all types of merges, but we only discuss
      • Merge (no fast forward)
        • Merge Fast Forward
      • Squash Merge
      • Rebase Merge
      • Semi-Linear Merge

We will discuss the contents in this article

  • A - Introduction
  • B - Merge in DevOps
  • C - Merge in GitHub
  • D - Merge in Visual StudioGitLab

Merge in DevOps

In DevOps, after you make a pull request, you may have the following 4 ways to merge the code into, say, master or maiin branch:

  • Merge (no fast forward)
  • Squash Merge
  • Rebase Merge
  • Semi-Linear Merge

Test Program:

For better understanding, I make this testing program:

Master --- this is client side code but always synchonized with server (DevOps, GitHub or GitLab):

Features --- in clinet side, it is a separate branch with the same starting point as master. It will be pushed to server, and choose different merge method to merge into master:

Pay attention on the time stamp (from bottom to top):

Merge (no fast forward):

Merge result:

Squash Commit Merge:

Merge result:

Rebase and Fast Forward Merge:

Merge result:

Semi-Linear Merge:

Merge result:

Merge in GitHub

In GitHub, after you make a pull request, you may have the following 3 ways to merge the code into, say, master or maiin branch:

  • Merge (no fast forward)
  • Squash Merge
  • Rebase Merge

Test Program:

The same structured test data, master:

Feature branch:

Merge (no fast forward):

Merge result:

Squesh and Merge:

Merge result:

Rebase and Merge:

Merge result:

Merge in GitLab

In GitLab, after you make a pull request, you may have more than several merge methods,

However, besides the basic two types below, others need to be configured, we will only disbuss these two basic types:

  • Merge (no fast forward)
  • Squash Merge

Test Program:

The same structured test data, master:

feature

The defualt choises are two basic: merge and squash merge:

Merge (no fast forwar):

Squash Merge:

 

Reference:


Similar Articles