一、 本地创建一条新的分支
repo start --all work1 (全部工程)
repo start work1 当前git库
git checkout work1 切换到新的分支工作
将本地已有的分支 和 远程分支连接
git branch --set-upstream-to=origin/master(远程分支名) work1(本地分支名)
二、创建新分支 并连到 远程另外一个分支
1. git branch --all 查看本地所有 分支
2. git remote show aosp -- 查看本地分支 与 远程分支的关系
3. 创建本地 “新分支” 并直接追踪 “远程另外一条”分支代码线
git branch work1(新分支名称) --track remotes/aosp/xxxxxxxctaMP( 这个就把上面 git branch --all 看到的所有远程分析,想要追踪的填写过来)
4. git remote show aosp -- 查看本地分支 与 远程分支的关系
5. git checkout work1 切换到work1 进行操作