gitless icon indicating copy to clipboard operation
gitless copied to clipboard

How to download a remote branch ?

Open chmike opened this issue 8 years ago • 2 comments

The gl init command downloads all the branches. In my case I want to copy locally a branch published by someone else after I did the init.

Is there an easy way to do that ?

Currently I assume I have to

  1. create a local branch with the desired name and attached on the same commit as the remote branch
  2. switch to that branch
  3. set the upstream branch to the remote branch
  4. do a fuse to get the remote commits

Is that the actual way to do it ? Is there a simpler way ?

chmike avatar Nov 23 '16 16:11 chmike

The way you did it is fine. You can also skip the last step using the dp/divergent-point flag:

  • gl branch -c my-local-branch -dp remote/the-remote-branch

(This will take care of downloading any commits that need to be downloaded)

  • gl switch my-local-branch
  • gl branch -su remote/the-remote-branch.

spderosso avatar Dec 09 '16 02:12 spderosso

I am going to label this issue as "docs". We should mention something about this on the documentation

spderosso avatar Dec 09 '16 02:12 spderosso