Git makes creating and managing branches very easy. In fact, the power and flexibility of its branching model is one of the biggest advantages of Git!
The "git branch" command is used for a variety of tasks:
creating new local branches
deleting existing local or remote branches
listing local and/or remote branches
listing branches that e.g. haven't been merged yet
create a new branch based on the current HEAD
$ git branch <new-branch>
create a new branch based on some existing one
$ git branch <new-branch> <base-branch>
create a new branch from a specific commit
$ git branch <new-branch> f71ac24d
create a new branch from a specific tag
$ git branch <new-branch> v1.2
create a new branch from a remote branch
$ git branch --track <new-branch> origin/<base-branch>
$ git checkout --track origin/<base-branch>
create a new branch in a remote repository
$ git push -u origin <local-branch>
No comments:
Post a Comment