Branch merging in gitlab

Step To Merge Branches In Git On GitLab

step to merge branches, We have already created an article on how to create branch in git. So I’m not going to explain it here You may follow these article if you do not know about it. 

In Git, Merge requests allow you to exchange the changes you made to your source code and collaborate with other people on the same project. This is the best way to work on files using branches.

Check Out : Create Branch in Git

Why do we need push code to master branch ?

As this is your main repository where all the files, code are tested & will send to git repository where Jenkins will receive the code and start the job in case if you’re using Jenkins. All the working code will be push to Master Branch.

Why we need another branch except Master ?

Suppose you want to test some cases, Code and you’re not going to push it to Master Branch until testing not done. Here branching concept comes in picture where you can work on another branch where you will test your code and later will have to push the master. You can also push the code to remote machine (failure Branch) it will not affect to Master Branch after all testing you can merge the code to Master and deploy your application etc.

Check Out : How To Change Gitlab Backup Path Location

Let’s begin Installation

As you can see there is only one file in Master Branch

1 : Check out failure branch, because our branch name is failure, where i was testing the code.

2 : Merge the failure branch to Master here

3 : After successfully merge failure branch to Master, You have to push the code to Master branch

Check Out : LDAP Authentication With Gitlab Server

4 : As you can see, That file was in failure branch

Now Master have all the files including faliure branch.

You’re done

Leave a Reply

avatar
  Subscribe  
Notify of