Your laptop pushed the store’s whole history to GitHub, and the token got it through. Soon you’ll clone the repository a second time, as the store’s back-office computer, and push from both folders. Pasting the token on every push would get old fast, especially since GitHub showed it to you only once.
In this lesson, you’ll make sure your computer remembers the token, so a second push doesn’t ask for it. You’ll also learn how to replace an expired token and what to do if one ever leaks. Start by finding out whether your computer already remembers it.
Let Git Remember the Token
Git itself doesn’t keep logins. It hands that job to a credential helper, a small program that Git asks for a login before asking you. After a push succeeds, Git gives the helper the login to keep.
With the setup in this lesson, the helper files the login under the host, github.com, not under a folder. So any clone of this repository on this computer, under your user account, gets the token, including the back-office clone you’ll make later. Git may offer it for other GitHub repositories too, but the token can’t push to any repository you didn’t select.
To see which helper your Git uses, and which configuration file set it, run this command in your generic-grocery folder:
$ git config --show-origin credential.helper
The answer depends on your system: