When we talk about programming, git is always there, no matter in which programming language you love to write code, learning git is always gonna to help you.
Coming to git, when you are developing a project, typing long commands again and again is not something we love to do so, in order to save time and make the git easier git aliasing comes in the way. Git aliasing makes the command shorter by renaming them.
You can take help of this by making alternative commands which are shorter, and easy to remember, for example you can use "gpom" for git push origin master.
So without wasting any time lets dive into creating our own alias. To getting started, open your command prompt and hit these four commands one after another.
git config --global alias.c "commit"
git config --global alias.a "add ."
git config --global alias.p "push"
git config --global alias.s "status"
Now as we have created the commands, not its time to check them out, to run the commands. you will need to enter these commands.
git c -m “Your commit message”
It's not always the case that we just have to run a single command, here chaining comes in the play, you can assign a single with multiple commands like you have to pull from the upstream master and push to origin, then you can write multiple commands separated by "&&".
git config --global alias.pp ‘!git pull upstream master && git push origin/master’.
Now you can run "pp" insted of two long commands.
Now we have learnt basic things about creating an alias, but maybe you want to use alise create by someone else then when you have to look at what commands do you have within the alise you can have a look at all the alise by hitting this command
git config — global alias.alias config — get-regexp ^alias\.