Skip to content

Instantly share code, notes, and snippets.

@alextorma
Created March 24, 2025 04:16
Show Gist options
  • Save alextorma/40f0b99859ed03c36c3485b634549381 to your computer and use it in GitHub Desktop.
Save alextorma/40f0b99859ed03c36c3485b634549381 to your computer and use it in GitHub Desktop.
Git (lazy) Wrapper
#! /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