How to create bash alias or alias functions for dynamic commands to pass line parameters in linux say ubuntu

Just edit the file ~/.bashrc by using the below command where in you will see all the bash commands 

gedit ~/.bashrc

Say now Im going to create bash alias function for dynamic command that is for git add files

We cannot simply run 

git add

We should pass the filenames to add the files to it, for this  you must create  alias as function now my alias is going to be ga for the below command

git add filename

so when We type

ga filename.php

 File should be added to git for commit so created a function _ga() in alias and a parameter defined as  $@ this one is for what ever you give next to ga, it will get as parameter and finally I'm calling the function at end _ga 

alias ga='_ga () { git add "$@"; }; _ga'

Now you need run the bashrc file 

. ~/.bashrc

# There must be space between . and ~

That its it now try

ga filename.php

Say now I need to add create function for git diff But for this one we need to add conditions we need to check whether diff is for overall or for just a single file, let see how can we do it?

git diff

git diff specificfile.php

Edit the bashrc file as I mentioned in the beginning and add this 

alias gd='_gd () { 
if [ -z "$@" ]; then
git diff;
git diff "$@";
fi  }; _gd'

# gd is the alias ,

# -z is to check whether the param is empty is to check whether the diff is for  specific file or overall diff

that its it :)

Now I want create alias for git commit. There is small problem, Now We have to access two different parameter, one is commit message and another is commit path say

git commit -m "commit message" /file/or/foldertocommit

So we will edit the bashrc file as mentioned in the beginning and add it

alias gc='_gc() { git commit -m "$1" "$2"; }; _gc'

# $1 and $2 specifies the order for params and it will get accordingly, say $1 is for commit message # @2 for folder/orfile/whatever

That is it for now bye :)