Home > Mobile >  Store GitHub token in a shell variable Linux Debian
Store GitHub token in a shell variable Linux Debian

Time:12-24

I am a new programmer, and also still a "noob" using Debian based distributions and Linux in general. Every time I push to my GitHub repository as u know, I have to write username and password which is my GitHub token, I have the token stored in a file and I have to enter the file copy the token and use it, and it's a bit annoying, I know it's possible to store commands in variables to make shell use faster, is there some sort of way to do the same with my token? or which would be a good practice to do so?

Thanks in advance for your time.

CodePudding user response:

I would suggest using SSH keys which you can find more information about Menu to select SSH instead of HTTPS

CodePudding user response:

You can cache your username/password with this command:

git config --global credential.helper 'cache --timeout=secs'

where secs (seconds) defaults to 900 (15 minutes).

  • Related