I'd like to create some functions/aliases in my .zshrc to help with git, but I'm not sure how.
First one:
Full command: git commit -s -m "My message"
My desired end result: gsc -m "My message"
Second one:
Full command: git commit -s -a -m "My message"
My desired end result: gsca "My message"
As you can see I want a macro that would call something with partial arguments and accept all other arguments whatever they may be from this macros call.
What I tried:
function gsc() { git commit -s $@; }alias gsc='git commit -s'
Neither of those worked.
My test:
> gsc -a -m "test"
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    smth.txt
nothing added to commit but untracked files present (use "git add" to track
    
-a.git addfirst?aliasand see if it is listed)