Is it possible to cache user credentials per terminal session in git?

Viewed 125

We are able to save user credentials for a specified time period with

git config --global credential.helper cache --timeout <the time to save the credentials in seconds>

but is it possible to instead have the credentials save per individual terminal session? What I mean by this is I want my credentials to be stored indefinitely for the current open terminal, but as soon as I restart the terminal or open a new session, I would have to log in again and cache for that specific terminal session. Is this possible? I find the timer method slightly annoying.

1 Answers
Related