There are two ways to achieve this:

On Disk

You can store your git credentials in your git config file by enabling the credential-helper.

git config --global credential.helper store

The first time after enabling this, you will be asked to give your username and password which will then be written in plaintext to the config file in /home/{username}/.gitconfig.

In Memory

You can store your git credentials in system memory by enabling the credential-helper with the cache command.

git config credential.helper 'cache --timeout='
This is will store your credentials for the duration of the timeout period in memory.
    I like to see who's visiting my website, do you accept?
    Do you want to accept tracking cookies?