mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 09:03:43 -05:00
Added git checkout with commit order and limit to 30 last commited branches
@@ -332,6 +332,15 @@ fbr() {
|
|||||||
git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
|
git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# fbr - checkout git branch (including remote branches), sorted by most recent commit, limit 30 last branches
|
||||||
|
fbr() {
|
||||||
|
local branches branch
|
||||||
|
branches=$(git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format="%(refname:short)") &&
|
||||||
|
branch=$(echo "$branches" |
|
||||||
|
fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) &&
|
||||||
|
git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
|
||||||
|
}
|
||||||
|
|
||||||
# fco - checkout git branch/tag
|
# fco - checkout git branch/tag
|
||||||
fco() {
|
fco() {
|
||||||
local tags branches target
|
local tags branches target
|
||||||
|
|||||||
Reference in New Issue
Block a user