~/.gitconfig
[credential "https://github.com"]
helper = github -b 'cache --timeout=86400'
This sets the credential helper for github using the cache helper with a timeout of 1 day
~/.gitconfig
[credential]
useHttpPath = true
[credential "https://github.com/Xgames123"] # change to your name
username=Xgames123 # change to your name
helper = github -b 'cache --timeout=86400'
Install git-credential-pass
~/.gitconfig
[credential "https://github.com"]
helper = github -b 'pass -p git/{host}/{username} -t ~/.config/git-credential-pass/default.template'
See git-credential-pass for more info