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

Post a Comment

Mới hơn Cũ hơn