Using SSH The common approach for handling git authentication is to delegate it to SSH. Typically you set your SSH public key in the remote repository (e.g. on GitHub), and then you use that whenever you need to authenticate. You can use a key agent of course, either handled by your desktop environment or manually with ssh-agent and ssh-add.
To avoid having to specify the username, you can configure that in SSH too, in ~/.ssh/config; for example I have
Host git.opendaylight.org User skitt and then I can clone using
git clone ssh://git.opendaylight.org:29418/aaa