Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

6.2. Manipulating branches

git-branch - List, create, or delete branches

6.2.1. list branches

$ git-branch
* master
			

6.2.2. create branches

$ git-branch mybranch
$ git-branch
* master
  mybranch
			

6.2.3. delete branches

$ git-branch -d mybranch
Deleted branch mybranch.

$ git-branch
* master
			

6.2.4. switch branch

$ git-branch
* master
  mybranch

$ git-checkout mybranch
Switched to branch "mybranch"

$ git-branch
  master
* mybranch
			

6.2.5. git-show-branch - Show branches and their commits

$ git-show-branch
! [master] add a new file
 * [mybranch] add a new file
--
+* [master] add a new file