Aliases we've written so far have been simple, there's what three of them, and we have not worked
with any arguments, we haven't passed any additional values to them.
For example, when we run get French, often we'll create a new branch instead of just looking at all
branches.
If we do get branch and then a branch name, it creates the branch.
That would be an argument of value.
We're passing to the command or get committed.
If we do them, we provide a commit message.
So how can I set up an alias, for example?
Let's say I just want see or maybe s.m for commit with a message so I could write that alias myself.
s.M equals commit Dasch m.
But then what about the message itself?
Well, the way that get aliases are set up, the way they're structured is that it will actually take
any arguments we pass to whatever our aliases, this command, if we pass something like first commit
for example, it will take that and pass it through here.
So it will just append it to the end.
So if we have two arguments that we pass through.
For whatever reason, it wouldn't make sense here, but if we did get would pass both of them in that
same order.
So this makes it really, really easy to define aliases that involve arguments.
We can do a lot more complex things, for example, s.m if we want that for commit message.
So I wouldn't just do see, because sometimes, you know, a lot of the time you need to write full,
commit messages, open it up in the editor multiple lines, follow a particular format template for
your message.
So I would do see them as the shortcut for Dash.
So if I just do that and I save, do I have any changes in here?
Let's do our get out or rather s I don't have anything to commit to, so let's just make a new file.
Let's do touch new jazz.
All right.
And then just get as again we can add new jazz.
We didn't set up an alias for that.
And now I can do get s.m and then a message like my new commit.
All right.
Oh, I totally forgot not to use exclamation points in the terminal, and if we take a look, get l
forget log, we see my new comet.
So we successfully made a new comet using s.m so we could do another example.
Get add there's another one, right.
We add files, we could just do a equals add and I can add as many arguments after, you know, file
one file too.
They all will be included.
They'll be passed through when I do get a they'll be password to get add.
So let's try that.
Here is the repository I'm working on.
Let's just add some changes to this read me file and to this JS file and to our package JSON.
I'm really destroying things, but should we change in here?
Maybe a version.
No, it doesn't matter.
I'm just making a lot of changes.
OK, so if I get X now instead of status, why not use our new alias if I want to add two of them,
the read Me and New Jersey, I can do get a and then read me and new.
Now, this only saves us two characters, right?
It's not that long of a command.
None of these are saving us a lot, although, you know, it's annoying to do like commit Desh AM.
But I'm going to show you in the next video some more complicated commands or aliases that people like
to use that will to steal.
Well, they're shared for us to use, so we will borrow.
But let me just demonstrate this.
So get a with these two arguments, they both were passed through those two values to get at, and if
we take a look at our status, both of them are ready to be committed.
And now we can do it with a message, you know, another commit yay!
And you get L and there we are, another commit yet.
OK, so you don't really have to worry about arguments.
You don't have to do anything fancy.
They're automatically passed through when you define an alias and call it.