Last active
May 11, 2023 10:08
-
-
Save ssiva13/8a71193eb9f242e4e2b47e504f9dc2d9 to your computer and use it in GitHub Desktop.
Creating a simple alias that takes an argument/parameter
This file contains 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
# 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