Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347125

Summary: [server] Need to create a local branch tracking a remote branch
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 347126, 347639    

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.