Storing your PAT in the server
To store your personal access token (PAT) in the server:
1. Have a PAT ready
If you already have a PAT that you can copy paste, you can skip to step 2. Otherwise, create or regenerate one. You can follow the instructions in the MEDS installation guide or create or regenerate one directly through GitHub.
2. Set up the git credential helper
Using the terminal, navigate to the directory from where you want to push your updates. Make sure you are on that directory (for example, verify you are on the
eds220-in-classby runningpwdon the terminal).Run the following command on the terminal:
git config --global credential.helper storeThis indicates to git that you want to store the PAT instead of caching it.
- Run
git config --global --liston the terminal. You should see something like this as the output:
user.name=carmengg
user.email=c_galazgarcia@ucsb.edu
credential.helper=storeThat last line indicates that the credential helper is now store.
3. Complete a push
Go through the steps to make a push. Git will prompt you for your credentials, use your GitHub username and use the PAT as the password. Press enter and finalize the push!
4. Verify credentials
Go to your user’s home directory by running
cd ~.Run
more .git-credentials. You should see something like this as the output:
https://carmengg:ghp_XTWwWrEtGfL45iIgU6PPDFd990ceIYydqY@github.comThis means your PAT is now stored (the PAT here is an example).
Git should have now stored your PAT on the server!
