Before people start bashing me up for posting something like this please listen.
I googled this command and found that
–needed
flag tells the reason for installation (Probably??) and
base-devel
is the group which contains the package git. What I couldn’t understand was the reason to explicitly define this. Couldn’t we still download the git package from arch repo without these flags?? So why such a bloated command how does this help??
It represents a package group that you want more than just a small part of. You need much more than just git to build most things. That command isn't bloated, as it won't install things that already exist thanks to --needed.
If you run pacman -Ss base-devel you will see git is not in group, which is why that's added on.