Git Authentication Guide

Generate a new Authentication Token 1. Generate a New GitHub Personal Access Token (PAT) Step 1: Go to GitHub Developer Settings Open GitHub in your browser and log in. Go to Settings (click your profile icon in the top right and select “Settings”). Scroll down and find Developer settings (on the left sidebar). Click Personal access tokens > Fine-grained tokens (recommended). Step 2: Generate a New Token Click Generate new token (Fine-grained token). Set a note for the token (e.g., “Git CLI access”). Set an expiration date (or “No expiration” if you want it permanent). Under Permissions, select: repo → Read and Write (for full repo access). workflow → Read and Write (if using GitHub Actions). Click Generate token. {% note danger %} ⚠ Important: Copy the token immediately! You won’t be able to see it again. {% endnote %} ...

April 22, 2025 · 6 min · 1133 words · xxraincandyxx

Git Commits

Rewrite Old Commits with the Correct Info If you already made commits with the wrong name/email and you want to fix your commit history, follow this: 1git filter-branch --env-filter ' 2OLD_EMAIL="wrong@email.com" 3CORRECT_NAME="Your Correct Name" 4CORRECT_EMAIL="your.correct@email.com" 5 6if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]; then 7 export GIT_COMMITTER_NAME="$CORRECT_NAME" 8 export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" 9fi 10if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; then 11 export GIT_AUTHOR_NAME="$CORRECT_NAME" 12 export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" 13fi 14' --tag-name-filter cat -- --branches --tags Rewrite every commit with the correct identity This doesn’t care what the old name/email was — it just replaces everything! 💥 ...

April 7, 2025 · 1 min · 153 words · xxraincandyxx

Git Config Guide

Change Git Global Config to the Correct Info This sets your default Git identity for all new commits from now on: 1git config --global user.name "your username" 2git config --global user.email "your.email@example.com" You can double-check it worked with: 1git config --global --list Set Git Default Editor Run one of the following commands in your terminal, replacing editor-command with your preferred editor: For Vim (default in many systems): 1git config --global core.editor "vim" For VS Code 1git config --global core.editor "code --wait" Verify Settings Check your configured editor with: ...

April 7, 2025 · 1 min · 102 words · xxraincandyxx