clone github 上的repository,如下:
1、檢視本地分支git clone git@github.com:fbing/design-patterns.git
使用 git branch命令,如下:
*標識的是你當前所在的分支。$ git branch
* master
2、檢視遠端分支
命令如下:
git branch -r
3、檢視所有分支
命令如下:
git branch -a
命令如下:
例如:git branch [branch name]
git branch gh-dev
命令如下:
例如:git checkout [branch name]
建立分支的同時切換到該分支上,命令如下:ricky@desktop-1qpastr mingw64 /f/git_studio/design-patterns (master)
$ git checkout gh-dev
switched to branch 'gh-dev'
ricky@desktop-1qpastr mingw64 /f/git_studio/design-patterns (gh-dev)
git checkout -b [branch name] 的效果相當於以下兩步操作:git checkout -b [branch name]
命令如下:git branch [branch name]
git checkout [branch name]
例如:git push origin [branch name]
git push origin gh-dev
命令如下:
git branch -d [branch name]
例如:
命令如下:git branch -d gh-dev
分支名前的冒號代表刪除。git push origin :[branch name]
例如:
git push origin :gh-dev
Github 建立新分支
clone github 上的repository,如下 git clone git github.com fbing design patterns.git1 檢視本地分支 使用 git branch命令,如下 git branch master 標識的是你當前所在的分支。2 檢視遠端分支 命令如...
在github上建立新分支
在github上建立倉庫 create a new repository on the command line touch readme.md git init git add readme.md git commit m first commit git remote add origin gi...
在github上建立新分支
在github上建立倉庫 create a new repository on the command line touch readme.md git init git add readme.md git commit m first commit git remote add origin gi...