We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ac6419 commit 2f18702Copy full SHA for 2f18702
functions/git.functions.sh
@@ -35,6 +35,21 @@ gswpr() {
35
git switch "$1"
36
}
37
38
+# Navigate between git worktrees with fzf, ordered by last commit date
39
+cdwt() {
40
+ local worktree_info last_commit_date
41
+
42
+ worktree_info=$(git worktree list --porcelain | grep "worktree " | awk '{print $2}' | while read -r wt; do
43
+ last_commit_date=$(cd "$wt" && git log -1 --format="%ct")
44
+ echo "$last_commit_date $wt"
45
+ done | sort -nr | awk '{print $2}' | fzf --height 40% --prompt="Select Worktree > ")
46
47
+ if [ -n "$worktree_info" ]; then
48
+ cd "$worktree_info" || return 1
49
+ fi
50
+}
51
52
53
# Show previously used conventional commit scopes
54
# Optional -n flag to sort numerically
55
gscopes() {
0 commit comments