How to merge branch to master git command line?

How to merge branch to master git command line?

In this post we will give you information about How to merge branch to master git command line?. Hear we will give you detail about How to merge branch to master git command line?And how to use it also give you demo for it if it is necessary.

Do you have question how to merge branch to master github command line? than i am here for help to git merge branch to master. i will guide you step by step how to merge branch in git. i written all command for github merge branch into master branch.

Almost developer knows how to pull, how to commit, how to add and how push. no some developer that don’t know how to create branch and merge branch with master.

Now in our field we are using git on our all laravel project as we can say. if you are working more than 3 developer than almost create developer wise own branch. developer work on his own branch. but than at last they merge in master branch. So how they are merge using command line i will show you step by step.

See also 

Solve - fatal: Unable to create '/myproject/.git/index.lock': File exi

In this post we will give you information about Solve - fatal: Unable to create '/myproject/.git/index.lock': File exi. Hear we will give you detail about Solve - fatal: Unable to create '/myproject/.git/index.lock': File exiAnd how to use it also give you demo for it if it is necessary.



When i was working on my laravel 5 application, i did all the changes i did but when i had gone for push then i found this fatal error. It's not able to create index.lock file in .git folder. I also give full permission to .git folder and also try to remove direct index.lock file from .git directory but same error like as bellow.

Error

fatal: Unable to create '/var/www/me/theme_backend/.git/index.lock': File exists.

But at last i found how can i resolve this problem, just run bellow command and it will work.

rm -f ./.git/index.lock

Hope this code and post will helped you for implement Solve - fatal: Unable to create '/myproject/.git/index.lock': File exi. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

You have to simple follow this tutorial, i written step by step command for merge branch and how it works.

You can merge branch using following command:

git merge dev

git push origin master

Step by Step Explanation of Create and Merge Branch with Github

I already created my demo repository on my github account. You can also create your own. i will clone my repo by using following command:

git clone git@github.com:savanihd/Demo-Git.git

After clone i will go on that project.

cd Demo-Git/

Now i will check how much branch in my repo now. right now i have only master. you can see both screen.

git branch

* master

Now create master.html file in your master branch as like bellow:

master.html

<!DOCTYPE html>

<html>

<head>

<title>Master File</title>

</head>

<body>

</body>

</html>

Now you can push this file on your master branch using following command:

git add .

git commit -m "master file created"

git push origin master

Now i will create new branch for development using following command:

git branch dev

Check branch is created or not:

git branch

dev

* master

We created dev branch but still we are in master branch. So now we have to checkout in dev branch using following command:

git checkout dev

git branch

* dev

master

Now we are in dev branch. So we will create dev.html file on dev branch. so let’s create with following code.

dev.html

<!DOCTYPE html>

<html>

<head>

<title>Dev File</title>

</head>

<body>

</body>

</html>

Now you can push this file on your dev branch using following command:

git add .

git commit -m "created dev file"

git push origin dev

Now we merge dev branch to master branch.

Let’s run following command:

Also see:How to git ignore file permissions changes for commit?

git checkout master

git merge dev

git push origin master

Now you can see on github repository and check it.

master branch merge with dev.

I hope it can help you…

Hope this code and post will helped you for implement How to merge branch to master git command line?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

2  +  2  =  

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US