Git create branch and merge

Create a new branch in git
$ git checkout -b branchname

check branch name
$ git branch -a

Switch/change to another branch
$ git checkout branchname

Push branch changes to git/github server
Once you added your changes in new branch and you want to push your commit to github, run below command:
$ git push origin branchname

How to merge your branch to master
$ git checkout master
$ git merge branchname
Share on Google Plus

About Md. Shahzad Alam

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment