alt text

If your git session forgets your credentials after 15 minutes on Linux then it could be that you’re using the cache instead of the store (for good reasons)

I’m using 2FA and have to use Personal Access Tokens to write access my repos:

GitHub push with 2FA (Personal Access Token)

From the GitHub docs Person Icon, Settings, Developer Settings, Personal access tokens.

Storing Git passwords from Stackoverflow

# default timeout of 15minutes
git config --global credential.helper cache

# stores on disk
git config --global credential.helper store

Hope this helps (and for my future self too)!