1

I have git on my system and github account. Historically when I want to pull, I was needed to type github login and password. That was beautiful because I remember this data by heart. Now I need to enter PAT (Personal Access Token) instead of password because of github restrictions. It works, but I can not remember PAT by heart. So, I want git not to ask me a github password (PAT) every time I push something in my own repo. I have found a recommendation to cast

git config --global credentials.helper store

but this script did nothing. Github recommends me to use Git Credential Manager but downloading a 100+MB software is not an option for my tiny SSD.

Is there any way not to destroy my programming process with the need to take my PAT data from somehow? Something likegit push password=./pat.txt will be enough good.

Eimrine
  • 57
  • 4
  • 1
    What about something like `cat credentials.txt|git push` where `credentials.txt` is a file containing your credentials? You could also create a wrapper script (e.g. `git-pc` for `git pc`) which essentially creates a new git command that just runs `git push` with your credentials. – dan1st Feb 12 '23 at 17:16

1 Answers1

2

You may choose to use gh in place of git for interacting with repositories on GitHub. gh has a size of about 10 MB and will cache your credentials by default (without requiring you to install any extension).

GitHub CLI will automatically store your Git credentials for you when you choose HTTPS as your preferred protocol for Git operations and answer "yes" to the prompt asking if you would like to authenticate to Git with your GitHub credentials.

~ GitHub CLI

Igwe Kalu
  • 14,286
  • 2
  • 29
  • 39