Skip to content

Instantly share code, notes, and snippets.

@ssiva13
Last active May 11, 2023 10:08
Show Gist options
  • Save ssiva13/8a71193eb9f242e4e2b47e504f9dc2d9 to your computer and use it in GitHub Desktop.
Save ssiva13/8a71193eb9f242e4e2b47e504f9dc2d9 to your computer and use it in GitHub Desktop.
Creating a simple alias that takes an argument/parameter
# example of a simple alias structure
alias g-s='git status'
# examples of aliases that can take an argument
# create new branch
alias g-b='function new_branch(){ git checkout -b $1; }; new_branch'
# create new branch with 'feature/' prefix
alias g-feature='function feature_branch(){ git checkout -b feature/$1; }; feature_branch'
# create new branch with 'bug/' prefix
alias g-bug='function bug_branch(){ git checkout -b bug/$1; }; bug_branch'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment