Remote
Remote
Git Tokens
Add tokens here
- Click on your Profile Icon (top-right on Github website)
- Settings
- Developer settings (bottom-left)
- Personal access tokens
- fine-grained tokens
- "Generate new token"
- Write a Token name
- Pick an expiration date from the menu or a custom one
- Repository access> All repositories
- Open "Repository permissions" menu
- Look for the "Contents" row
- From the menu at right select "Access> Read and Write"
- "Generate token" (bottom-left)
Github Gist
Authentication Github Gist using “Github Desktop” didn’t work for me. My main password didn’t work so I created one more Github Token for just “Gist” permission.
And by opening iTerm2 via Github Desktop I was able to push the gist changes by entering my newly generate authorization token.
Check Remote
Check Git Remote urls on CLI
git remote -v
Changing Remote
Changing remote origin git urls.
# remove origin
git remote remove origin
`https://github.com/SensehacK/repo\_name`
`repo_full_url` = https://SensehacK:github_pat_token_@github.com/SensehacK/dev-cheatsheet
Add the newly updated remote origin with personal access token (PAT)
git remote add origin `repo_full_url`
git remote set-url origin repo_full_url
git push --set-upstream origin main
git remote add origin