how to login to git from terminal

C++
git config --global user.name "your_username"
git config --global user.email "[email protected]"

Source

Also in C++: