sodapopcan / vim-twiggy

Git branch management for Vim
282 stars 16 forks source link

Fetch all remote branches #32

Open roblevy opened 5 years ago

roblevy commented 5 years ago

💡 Feature Description

I want to pull a remote branch which I've never had in my local repo. I can fetch per-branch but to fetch every remote branch I need to do Gfetch --all. Given that there's a list of remote branches on Twiggy, I thought there might be a way to fetch all the remote branches. I notice that F isn't mapped yet in Twiggy.

💻 Example Usage

A user has been working on branch1 and has already pushed to the remote:

r:origin
  HEAD
  branch1

A colleague has pushed branch2 to the remote but this doesn't show up yet in Twiggy. The user presses F and the remote branch list updates (just like doing Gfetch --all does):

r:origin
  HEAD
  branch1
  branch2
sodapopcan commented 4 years ago

Sorry for the incredibly long delay here.

I've found coming up with mappings for twiggy incredibly hard and, honestly, I don't use most of them. Having said that, I think what would make sense here is that F with the cursor on local branches would do a git fetch --all whereas F on a specific remote would only fetch for that remote. That may end up being too complex, though, so maybe just F does a git fetch --all from anywhere. What do you think?

maujim commented 3 years ago

I was looking to opening a PR for this as well, I think F for git fetch --all is the most intuitive solution