wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.4k stars 137 forks source link

Sorting branches by last checkout #181

Closed timsofteng closed 2 years ago

timsofteng commented 2 years ago

Hello. Is it possible to add sorting git branches by last checkout? I want to see branch where I was working before current brunch above it in fzf list.

cjappl commented 2 years ago

This is for which command?

gcb?

timsofteng commented 2 years ago

This is for which command?

gcb?

Yes. Sorry for the late response. I feel sorting by date is way more comfortable.

cjappl commented 2 years ago

Cool, @wfxr have any issue with this?

I can look into it when I get a chance, but as long as he approves, we accept PRs @timsofteng ! I would guess this isn't too big or hard of a change

wfxr commented 2 years ago

@timsofteng It's hard to implement branch LRU sorting unless git provide a api. But you can always use - as a short name of the previous branch:

$ git switch -                 # switch to the previous branch
$ git rebase -                 # rebase from the previous branch
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.