Last active
March 29, 2023 15:32
-
-
Save jodersky/fb4247d26417a05074f6906138fc42f2 to your computer and use it in GitHub Desktop.
A custom git script which is helpful if you work on many branches concurrently and forget their names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USAGE="<pattern>" | |
LONG_USAGE="list most recently used branches that start with <pattern>" | |
# shellcheck source=/dev/null | |
. "$(git --exec-path)/git-sh-setup" | |
branches=$(git branch --sort=committerdate --list "$1*" --no-merged master --format='%(refname:short)'| tail -n 5) | |
for branch in $branches; do | |
echo -e "\033[1m$branch\033[0m" | |
echo "first: " "$(git log master.."$branch" --oneline | tail -1)" | |
echo "last: " "$(git log -1 "$branch" --oneline)" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git wip jo