Skip to content

Instantly share code, notes, and snippets.

@peppapig13132
Last active June 16, 2024 12:59
Show Gist options
  • Save peppapig13132/e4fdfd09d0b2581b318698b033e4f1bf to your computer and use it in GitHub Desktop.
Save peppapig13132/e4fdfd09d0b2581b318698b033e4f1bf to your computer and use it in GitHub Desktop.
GitHub

GitHub SSH

$ ssh-keygen -t rsa -b 4096 -C "YOUR_GITHUB_EMAIL"
# C:\Users\Admin\.ssh\config

#GITHUB_USERNAME
Host YOUR_ACCOUNT_NAME.github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/GITHUB_USERNAME
git@GITHUB_USERNAME.github.com:GITHUB_USERNAME/repository_name.git

Last Commit Update

$ git commit --amend -m "NEW_COMMIT"
$ git push --force origin main

Reset remote origin URL

# Checking current remote URL
git remote -v

# Set new URL
git remote set-url origin git@NEW_GITHUB_USERNAME.github.com:NEW_GITHUB_USERNAME/NEW_REPOSITORY_NAME.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment