How to push changes from local git repo to GitHub with Finegrained Personal Access Token (PAT)
Make sure your .env file is loaded in the shell:
This sets GH_TOKEN as an environment variable.
Configure Git to use the token for HTTPS:
Push using the token without embedding it in the URL:
-c http.extraheader="AUTHORIZATION: bearer $GH_TOKEN" tells Git to use the token for authentication just for this command. This way your token is never saved in Git config or remote URLs.