Created
March 24, 2025 04:16
-
-
Save alextorma/40f0b99859ed03c36c3485b634549381 to your computer and use it in GitHub Desktop.
Git (lazy) Wrapper
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
#! /usr/bin/env bash | |
git() { | |
local git_cmd="/usr/bin/git" | |
local clean_args=() | |
# Loop through all arguments | |
for arg in "$@"; do | |
if [[ "$arg" == "lazy" ]]; then | |
git_cmd="lazygit" | |
else | |
clean_args+=("$arg") | |
fi | |
done | |
# Pass remaining arguments to git | |
$git_cmd "${clean_args[@]}" | |
} | |
git "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment