Step To Merge Branches In Git & Send To GitLab Server

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

Step To Merge Branches In Git On GitLab:

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 a 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 a push to Master Branch.

Why we need another branch except for 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 the 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 the 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

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

step To Merge Branches

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

merge branch in gitlab

2: Merge the failure branch to Master here

gitlab merge branch to master

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

Check Out: LDAP Authentication With Gitlab Server

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

Now Master has all the files including the failure branch.

You’re done merge branch in gitlab gitlab merge branch t branch merge to master gitlab create branch o master

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment