Skip to content

Instantly share code, notes, and snippets.

@nkaurelien
Created October 26, 2024 21:57
Show Gist options
  • Save nkaurelien/1a72e8fe752cb39574aa73e7cee7a80a to your computer and use it in GitHub Desktop.
Save nkaurelien/1a72e8fe752cb39574aa73e7cee7a80a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Define aliases with clear descriptions
alias gi='git init'
alias gc='git clone'
alias gst='git status'
alias ga='git add'
alias gcmm='git commit -m'
alias gl='git log'
alias gb='git branch'
alias gco='git checkout'
alias gm='git merge'
alias gbd='git branch -D'
alias gr='git remote'
alias gra='git remote add'
alias gp='git push'
alias gpl='git pull'
alias gpf='git fetch'
alias grh='git reset --hard HEAD'
alias grv='git revert'
# Print a usage message if no arguments are provided
if [[ $# -eq 0 ]]; then
echo "Usage: $0 <command> [options]"
echo "Available aliases:"
echo " gi: git init"
echo " gc: git clone"
echo " gst: git status"
echo " ga: git add"
echo " gcmm: git commit -m"
echo " gl: git log"
echo " gb: git branch"
echo " gco: git checkout"
echo " gm: git merge"
echo " gbd: git branch -D"
echo " gr: git remote"
echo " gra: git remote add"
echo " gp: git push"
echo " gpl: git pull"
echo " gpf: git fetch"
echo " grh: git reset --hard HEAD"
echo " grv: git revert"
exit 1
fi
# Execute the command with arguments
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment