Skip to content

GitHub

Checking which Git account/identity is configured

git config user.name
git config user.email
This shows the identity that will be attached to my commits for this specific repo (local config overrides global).

Check which remote + credential is being used

If a remote is already set

git remote -v

Check which SSH key is being used

ssh -T git@github.com

If no remote exists yet:

git remote add origin https://github.com/yourusername/your-repo-name.git
#or
git remote add origin git@github.com:username/FoodTracker.git

If a remote already exists but is wrong:

git remote set-url origin https://github.com/yourusername/your-repo-name.git

To set the correct identity for just my repo (without changing global)

git config user.name "Your Correct Name"
git config user.email "correct-email@example.com"
rm -rf .git
git init
git add .
git commit -m "Initial commit"