Skip to content

Commit

Permalink
git col
Browse files Browse the repository at this point in the history
  • Loading branch information
nonrational committed Dec 13, 2023
1 parent 10503b3 commit f38ba5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

ci = commit -v
co = checkout
col = "!. ~/.githelpers && checkout_first_matching"

df = "diff --name-only"
dfo = "df origin/master"
Expand Down
8 changes: 8 additions & 0 deletions .githelpers
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ delete_all_my_branches_interactive(){
done
}

checkout_first_matching() {
if [ -z "$1" ]; then
echo "No pattern provided"
else
git branch | egrep "$1" | head -1 | xargs git checkout
fi
}

TIMESINCE="function timeSince(date) {\
var seconds = Math.floor((new Date() - date) / 1000);\
var interval = Math.floor(seconds / 31536000);\
Expand Down

0 comments on commit f38ba5d

Please sign in to comment.