Skip to content

Instantly share code, notes, and snippets.

View mfranceschit's full-sized avatar

Marco Franceschi mfranceschit

View GitHub Profile
@mfranceschit
mfranceschit / github-with-pat.md
Last active September 29, 2025 20:37
Authenticate with Personal Access Token (PAT) on GitHub
  1. First, follow these steps to create a fine-grained personal access token.

  2. Add the generated token github_pat_***** to your environment using a export GITHUB_TOKEN=**** variable.

  3. 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'

  4. Verify everything is configured using git config --global credential.helper.

  5. That's it. Happy coding!