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.
How to revoke 'git add' before 'git commit' ?
In this post we will give you information about How to revoke 'git add' before 'git commit' ?. Hear we will give you detail about How to revoke 'git add' before 'git commit' ?And how to use it also give you demo for it if it is necessary.
Sometimes you need to undo your git file before you git comment command. Because you made a some misteck or wrong code and you did git add using "git add ." command then you think how to undo your code before git commit command. But you can do that using git reset command, if you need to undo all file Or you may need to undo just one then you can do using git reset command, you can see bellow command.
Example:
// For Spesific filegit reset
// For all files
git reset
Hope this code and post will helped you for implement How to revoke 'git add' before 'git commit' ?. 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
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:
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