Bug 347125 - [server] Need to create a local branch tracking a remote branch
Summary: [server] Need to create a local branch tracking a remote branch
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 347126 347639
  Show dependency tree
 
Reported: 2011-05-25 05:20 EDT by Szymon Brandys CLA
Modified: 2011-09-01 11:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2011-05-25 05:20:36 EDT
I need to be able to create and checkout a local branch for a remote tracking branch. After discussion with Tomasz, we could enhance our Branch API by
adding two parameters to request body of POST /git/branch/... i.e.
- Checkout (false/true) indicating that newly created branch should be checked out immediately
- SrcRefSpec? to specify for what ref the new branch is created
Comment 1 Tomasz Zarna CLA 2011-05-25 10:48:56 EDT
(In reply to comment #0)
> - Checkout (false/true) indicating that newly created branch should be checked
> out immediately

which would be an equivalent of "git checkout -b {branch}" or "git checkout --track -b {local} {remote}/{branch}" for remote branches

> - SrcRefSpec? to specify for what ref the new branch is created

which would be an equivalent of "git branch {branch} {commit}".
Comment 2 Szymon Brandys CLA 2011-05-27 04:27:51 EDT
For now I need "git checkout -t {remote}/{branch}"
Comment 3 Szymon Brandys CLA 2011-05-30 07:40:35 EDT
I added git branch --track <branchname> [<start-point>]. The client will call it first and then git checkout on <branchname>. I'm opening a separate bug for test updates.
Comment 4 Szymon Brandys CLA 2011-05-30 07:46:12 EDT
Fixed with 7708d714757dc89aa41acd85524757dc25fe2eb6. I'm also changing the summary to better reflect the reality.