-
First, follow these steps to create a fine-grained personal access token.
-
Add the generated token
github_pat_*****
to your environment using aexport GITHUB_TOKEN=****
variable. -
Replace your username on GitHub in the following command
git config --global credential.helper '!f() { sleep 1; echo "username=[username]"; echo "password=${GITHUB_TOKEN}"; }; f'
-
Verify everything is configured using
git config --global credential.helper
. -
That's it. Happy coding!