在这里,使用github
和git version 2.1.4
,只需执行以下操作:
$ git clone git@github.com:user/repo.git
即使没有本地链接,遥控器也由itelsef提供:
$ git remote show origin
* remote origin
Fetch URL: git@github.com:user/repo.git
Push URL: git@github.com:user/repo.git
HEAD branch: master
Remote branches:
develop tracked <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
但是,当然,仍然没有本地分支机构:
$ git branch
* master <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
看到?现在,如果您仅结帐开发,它将自动完成魔术:
$ git checkout develop
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
太简单!
摘要。只需运行以下两个命令:
$ git clone git@github.com:user/repo.git
$ git checkout develop
git push -u origin branch-name
。