gitless icon indicating copy to clipboard operation
gitless copied to clipboard

What is the equivalent of fetch in gitless?

Open BarrySmith opened this issue 8 years ago • 4 comments
trafficstars

Someone updated the remote git repository with a new branch, with git I'd do a git fetch and then I could git checkout that branch. How do I access that new branch with gitless? Thanks

BarrySmith avatar Feb 28 '17 19:02 BarrySmith

Let's say your remote is origin and the new branch is foo. Then, to create a local branch from a remote branch, you would do gl branch -c foo -dp origin/foo. This command is saying "create a local branch of name foo with a head equal to the head of the remote branch origin/foo". This will take care of downloading any necessary commits (i.e., doing a git fetch for you)

Let me know if it worked, thanks

spderosso avatar Feb 28 '17 20:02 spderosso

Works, thanks.

How do I get a list of all the branches in the remote repository; that may not exist locally?

BarrySmith avatar Feb 28 '17 20:02 BarrySmith

gl branch -r will list remote branches

spderosso avatar Feb 28 '17 20:02 spderosso

the gl branch --create foo --divergent-point origin/point trick works. However I think it's not user friendly.

my expectative is somethnig like once I do:

gl branch --remote

To thee all the remote branches. I courd do someting like gl branch --create-from-remote origin/foo and that would create a foo local branch.

or

gl branch --create foo --with-remote origin/foo

PS: thank you for gitless I really enjoy using it. and it made me read the "Essence of Software"

elviejo79 avatar Apr 02 '22 02:04 elviejo79