git初始化一般是這樣。
git init
git clone [remote repository address (.git地址)]
之後重點來了,因爲clone下來的一般爲master分支,有可能不是想拉下來的分支。可以使用以下的方法
git branch -a 先查看當前遠端分支情況
git checkout origin/<branch name> 選擇遠端name分支
git branch <branch name> 創建本地name分支
git branch 查看本地分支情況
git checkout <branch name> 選擇本地已創建的分支就可以了
直接指定clone某個分支:
git clone -b <branch name> [remote repository address]
栗子[clone dubbo master branch code]:git clone -b master https://github.com/apache/incubator-dubbo.git